From 0d8856262e965f05b4cdb2485c94c63b25913d95 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Wed, 20 May 2026 23:54:06 -0700 Subject: [PATCH 1/9] Use the Crossplane CLI instead of the Upbound CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modelplane depends on the Upbound up CLI for project tooling: building function images, generating Pydantic models, running composition tests, and pushing packages. The project tooling is being upstreamed into the Crossplane CLI (https://github.com/crossplane/crossplane/issues/6840), which is now available at github.com/crossplane/cli. Modelplane is open source and built on Crossplane — contributors should not need the Upbound CLI. This commit replaces the up CLI with the Crossplane CLI and restructures the Python functions to match its expectations. The Crossplane CLI's Python builder expects each function to be a hatch-buildable package (pyproject.toml + function/ directory) rather than a bare main.py with symlinks to shared code. This is a fundamental change to how functions are structured, built, and tested. Project manifest: - upbound.yaml (meta.dev.upbound.io/v2alpha1) is replaced by crossplane-project.yaml (dev.crossplane.io/v1alpha1) with typed dependencies. function-auto-ready is dropped (unused). Function structure: - Each function is now a self-contained hatch package under functions// with pyproject.toml, function/fn.py (FunctionRunner + Composer), function/main.py (CLI entrypoint), and function/_compat.py (SDK shims pending upstream). - The lib/ shared library is eliminated. Helpers that belong in the SDK (set_conditions, update_status, child_name) are shimmed locally via _compat.py until https://github.com/crossplane/function-sdk-python/pull/205 ships. Everything else is inlined into the function that uses it. - The lib/model symlinks are gone. Functions import generated models from the crossplane-models package at schemas/python/. Tests: - Composition tests using up's CompositionTest schema are replaced by unittest-based tests co-located with each function at functions//tests/test_fn.py. Tests call RunFunction directly and compare the full RunFunctionResponse via MessageToDict. Nix: - The up and docker-credential-up binaries are replaced by a crossplane binary extracted from the crossplane/cli flake. docker-credential-up is retained for xpkg.upbound.io registry authentication. - nix run .#test-crossplane now builds the project, creates a venv with function dependencies, and runs unittest across all functions. - nix run .#format is added for code formatting. CI: - The upbound/action-up login step is removed. Registry auth uses standard Docker credentials. Addresses https://github.com/modelplaneai/modelplane/issues/13. Signed-off-by: Nic Cope --- .github/workflows/ci.yml | 15 +- .gitignore | 2 + CONTRIBUTING.md | 83 +- crossplane-project.yaml | 45 + docs/getting-started.md | 20 +- docs/pull-secret.yaml | 12 +- flake.lock | 112 +- flake.nix | 37 +- .../compose-gke-cluster/function}/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 121 +- .../compose-gke-cluster/function/main.py | 41 + functions/compose-gke-cluster/lib | 1 - functions/compose-gke-cluster/model | 1 - functions/compose-gke-cluster/pyproject.toml | 29 + .../compose-gke-cluster/tests/__init__.py | 1 + .../compose-gke-cluster/tests/test_fn.py | 669 +++++++++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../compose-inference-class/function/fn.py | 35 + .../compose-inference-class/function/main.py | 41 + functions/compose-inference-class/lib | 1 - functions/compose-inference-class/main.py | 25 - functions/compose-inference-class/model | 1 - .../compose-inference-class/pyproject.toml | 29 + .../compose-inference-class/tests/__init__.py | 0 .../compose-inference-class/tests/test_fn.py | 84 ++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 137 +- .../function/main.py | 41 + functions/compose-inference-cluster/lib | 1 - functions/compose-inference-cluster/model | 1 - .../compose-inference-cluster/pyproject.toml | 29 + .../tests/__init__.py | 1 + .../tests/test_fn.py | 452 ++++++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 154 +- .../function/main.py | 41 + functions/compose-inference-gateway/lib | 1 - functions/compose-inference-gateway/model | 1 - .../compose-inference-gateway/pyproject.toml | 29 + .../tests/__init__.py | 1 + .../tests/test_fn.py | 294 ++++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 261 +++- .../inference_extension_crds.json | 0 .../inference_extension_crds.yaml | 0 .../compose-kserve-backend/function/main.py | 41 + functions/compose-kserve-backend/lib | 1 - functions/compose-kserve-backend/model | 1 - .../compose-kserve-backend/pyproject.toml | 29 + .../compose-kserve-backend/tests/__init__.py | 1 + .../compose-kserve-backend/tests/test_fn.py | 1251 +++++++++++++++++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 143 +- .../compose-model-deployment/function/main.py | 41 + .../{ => function}/scheduling.py | 15 +- functions/compose-model-deployment/lib | 1 - functions/compose-model-deployment/model | 1 - .../compose-model-deployment/pyproject.toml | 29 + .../tests/__init__.py | 0 .../compose-model-deployment/tests/test_fn.py | 434 ++++++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 62 +- .../compose-model-endpoint/function/main.py | 41 + functions/compose-model-endpoint/lib | 1 - functions/compose-model-endpoint/model | 1 - .../compose-model-endpoint/pyproject.toml | 29 + .../compose-model-endpoint/tests/__init__.py | 0 .../compose-model-endpoint/tests/test_fn.py | 173 +++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 115 +- .../compose-model-replica/function/main.py | 41 + functions/compose-model-replica/lib | 1 - functions/compose-model-replica/model | 1 - .../compose-model-replica/pyproject.toml | 29 + .../compose-model-replica/tests/__init__.py | 0 .../compose-model-replica/tests/test_fn.py | 263 ++++ .../function/__init__.py | 0 .../function/__version__.py | 3 + .../{main.py => function/fn.py} | 129 +- .../compose-model-service/function/main.py | 41 + functions/compose-model-service/lib | 1 - functions/compose-model-service/model | 1 - .../compose-model-service/pyproject.toml | 29 + .../compose-model-service/tests/__init__.py | 0 .../compose-model-service/tests/test_fn.py | 282 ++++ lib/conditions.py | 62 - lib/defaults.py | 42 - lib/helm.py | 55 - lib/k8s.py | 36 - lib/keda.py | 23 - lib/metadata.py | 31 - lib/naming.py | 61 - lib/prometheus.py | 77 - lib/resource.py | 61 - lib/secrets.py | 17 - nix/apps.nix | 77 +- nix/build.nix | 66 +- nix/checks.nix | 4 +- pyproject.toml | 16 +- skills/crossplane-python-functions/SKILL.md | 81 +- .../references/example.py | 8 +- tests/test-backend-second-pass/lib | 1 - tests/test-backend-second-pass/main.py | 123 -- tests/test-backend-second-pass/model | 1 - tests/test-backend-second-pass/xr.yaml | 24 - tests/test-backend/lib | 1 - tests/test-backend/main.py | 73 - tests/test-backend/model | 1 - tests/test-backend/xr.yaml | 24 - tests/test-gkecluster/lib | 1 - tests/test-gkecluster/main.py | 236 ---- tests/test-gkecluster/model | 1 - tests/test-gkecluster/xr.yaml | 28 - tests/test-inference-cluster-existing/lib | 1 - tests/test-inference-cluster-existing/main.py | 132 -- tests/test-inference-cluster-existing/model | 1 - tests/test-inference-cluster-existing/xr.yaml | 18 - tests/test-inference-cluster/lib | 1 - tests/test-inference-cluster/main.py | 236 ---- tests/test-inference-cluster/model | 1 - tests/test-inference-cluster/xr.yaml | 22 - tests/test-inference-gateway-second-pass/lib | 1 - .../main.py | 96 -- .../test-inference-gateway-second-pass/model | 1 - .../xr.yaml | 13 - tests/test-inference-gateway/lib | 1 - tests/test-inference-gateway/main.py | 46 - tests/test-inference-gateway/model | 1 - tests/test-inference-gateway/xr.yaml | 13 - .../lib | 1 - .../main.py | 140 -- .../model | 1 - .../xr.yaml | 20 - .../lib | 1 - .../main.py | 96 -- .../model | 1 - .../xr.yaml | 18 - tests/test-model-deployment-not-ready/lib | 1 - tests/test-model-deployment-not-ready/main.py | 94 -- tests/test-model-deployment-not-ready/model | 1 - tests/test-model-deployment-not-ready/xr.yaml | 17 - .../lib | 1 - .../main.py | 179 --- .../model | 1 - .../xr.yaml | 17 - tests/test-model-deployment/lib | 1 - tests/test-model-deployment/main.py | 148 -- tests/test-model-deployment/model | 1 - tests/test-model-deployment/xr.yaml | 17 - tests/test-model-endpoint/lib | 1 - tests/test-model-endpoint/main.py | 36 - tests/test-model-endpoint/model | 1 - tests/test-model-endpoint/xr.yaml | 10 - tests/test-model-replica-multinode/lib | 1 - tests/test-model-replica-multinode/main.py | 119 -- tests/test-model-replica-multinode/model | 1 - tests/test-model-replica-multinode/xr.yaml | 22 - tests/test-model-replica/lib | 1 - tests/test-model-replica/main.py | 105 -- tests/test-model-replica/model | 1 - tests/test-model-replica/xr.yaml | 20 - tests/test-model-service/lib | 1 - tests/test-model-service/main.py | 126 -- tests/test-model-service/model | 1 - tests/test-model-service/xr.yaml | 10 - upbound.yaml | 43 - 174 files changed, 5813 insertions(+), 3361 deletions(-) create mode 100644 crossplane-project.yaml rename {lib => functions/compose-gke-cluster/function}/__init__.py (100%) create mode 100644 functions/compose-gke-cluster/function/__version__.py rename functions/compose-gke-cluster/{main.py => function/fn.py} (80%) create mode 100644 functions/compose-gke-cluster/function/main.py delete mode 120000 functions/compose-gke-cluster/lib delete mode 120000 functions/compose-gke-cluster/model create mode 100644 functions/compose-gke-cluster/pyproject.toml create mode 100644 functions/compose-gke-cluster/tests/__init__.py create mode 100644 functions/compose-gke-cluster/tests/test_fn.py rename tests/.gitkeep => functions/compose-inference-class/function/__init__.py (100%) create mode 100644 functions/compose-inference-class/function/__version__.py create mode 100644 functions/compose-inference-class/function/fn.py create mode 100644 functions/compose-inference-class/function/main.py delete mode 120000 functions/compose-inference-class/lib delete mode 100644 functions/compose-inference-class/main.py delete mode 120000 functions/compose-inference-class/model create mode 100644 functions/compose-inference-class/pyproject.toml create mode 100644 functions/compose-inference-class/tests/__init__.py create mode 100644 functions/compose-inference-class/tests/test_fn.py create mode 100644 functions/compose-inference-cluster/function/__init__.py create mode 100644 functions/compose-inference-cluster/function/__version__.py rename functions/compose-inference-cluster/{main.py => function/fn.py} (78%) create mode 100644 functions/compose-inference-cluster/function/main.py delete mode 120000 functions/compose-inference-cluster/lib delete mode 120000 functions/compose-inference-cluster/model create mode 100644 functions/compose-inference-cluster/pyproject.toml create mode 100644 functions/compose-inference-cluster/tests/__init__.py create mode 100644 functions/compose-inference-cluster/tests/test_fn.py create mode 100644 functions/compose-inference-gateway/function/__init__.py create mode 100644 functions/compose-inference-gateway/function/__version__.py rename functions/compose-inference-gateway/{main.py => function/fn.py} (64%) create mode 100644 functions/compose-inference-gateway/function/main.py delete mode 120000 functions/compose-inference-gateway/lib delete mode 120000 functions/compose-inference-gateway/model create mode 100644 functions/compose-inference-gateway/pyproject.toml create mode 100644 functions/compose-inference-gateway/tests/__init__.py create mode 100644 functions/compose-inference-gateway/tests/test_fn.py create mode 100644 functions/compose-kserve-backend/function/__init__.py create mode 100644 functions/compose-kserve-backend/function/__version__.py rename functions/compose-kserve-backend/{main.py => function/fn.py} (71%) rename functions/compose-kserve-backend/{ => function}/inference_extension_crds.json (100%) rename functions/compose-kserve-backend/{ => function}/inference_extension_crds.yaml (100%) create mode 100644 functions/compose-kserve-backend/function/main.py delete mode 120000 functions/compose-kserve-backend/lib delete mode 120000 functions/compose-kserve-backend/model create mode 100644 functions/compose-kserve-backend/pyproject.toml create mode 100644 functions/compose-kserve-backend/tests/__init__.py create mode 100644 functions/compose-kserve-backend/tests/test_fn.py create mode 100644 functions/compose-model-deployment/function/__init__.py create mode 100644 functions/compose-model-deployment/function/__version__.py rename functions/compose-model-deployment/{main.py => function/fn.py} (63%) create mode 100644 functions/compose-model-deployment/function/main.py rename functions/compose-model-deployment/{ => function}/scheduling.py (89%) delete mode 120000 functions/compose-model-deployment/lib delete mode 120000 functions/compose-model-deployment/model create mode 100644 functions/compose-model-deployment/pyproject.toml create mode 100644 functions/compose-model-deployment/tests/__init__.py create mode 100644 functions/compose-model-deployment/tests/test_fn.py create mode 100644 functions/compose-model-endpoint/function/__init__.py create mode 100644 functions/compose-model-endpoint/function/__version__.py rename functions/compose-model-endpoint/{main.py => function/fn.py} (64%) create mode 100644 functions/compose-model-endpoint/function/main.py delete mode 120000 functions/compose-model-endpoint/lib delete mode 120000 functions/compose-model-endpoint/model create mode 100644 functions/compose-model-endpoint/pyproject.toml create mode 100644 functions/compose-model-endpoint/tests/__init__.py create mode 100644 functions/compose-model-endpoint/tests/test_fn.py create mode 100644 functions/compose-model-replica/function/__init__.py create mode 100644 functions/compose-model-replica/function/__version__.py rename functions/compose-model-replica/{main.py => function/fn.py} (71%) create mode 100644 functions/compose-model-replica/function/main.py delete mode 120000 functions/compose-model-replica/lib delete mode 120000 functions/compose-model-replica/model create mode 100644 functions/compose-model-replica/pyproject.toml create mode 100644 functions/compose-model-replica/tests/__init__.py create mode 100644 functions/compose-model-replica/tests/test_fn.py create mode 100644 functions/compose-model-service/function/__init__.py create mode 100644 functions/compose-model-service/function/__version__.py rename functions/compose-model-service/{main.py => function/fn.py} (61%) create mode 100644 functions/compose-model-service/function/main.py delete mode 120000 functions/compose-model-service/lib delete mode 120000 functions/compose-model-service/model create mode 100644 functions/compose-model-service/pyproject.toml create mode 100644 functions/compose-model-service/tests/__init__.py create mode 100644 functions/compose-model-service/tests/test_fn.py delete mode 100644 lib/conditions.py delete mode 100644 lib/defaults.py delete mode 100644 lib/helm.py delete mode 100644 lib/k8s.py delete mode 100644 lib/keda.py delete mode 100644 lib/metadata.py delete mode 100644 lib/naming.py delete mode 100644 lib/prometheus.py delete mode 100644 lib/resource.py delete mode 100644 lib/secrets.py delete mode 120000 tests/test-backend-second-pass/lib delete mode 100644 tests/test-backend-second-pass/main.py delete mode 120000 tests/test-backend-second-pass/model delete mode 100644 tests/test-backend-second-pass/xr.yaml delete mode 120000 tests/test-backend/lib delete mode 100644 tests/test-backend/main.py delete mode 120000 tests/test-backend/model delete mode 100644 tests/test-backend/xr.yaml delete mode 120000 tests/test-gkecluster/lib delete mode 100644 tests/test-gkecluster/main.py delete mode 120000 tests/test-gkecluster/model delete mode 100644 tests/test-gkecluster/xr.yaml delete mode 120000 tests/test-inference-cluster-existing/lib delete mode 100644 tests/test-inference-cluster-existing/main.py delete mode 120000 tests/test-inference-cluster-existing/model delete mode 100644 tests/test-inference-cluster-existing/xr.yaml delete mode 120000 tests/test-inference-cluster/lib delete mode 100644 tests/test-inference-cluster/main.py delete mode 120000 tests/test-inference-cluster/model delete mode 100644 tests/test-inference-cluster/xr.yaml delete mode 120000 tests/test-inference-gateway-second-pass/lib delete mode 100644 tests/test-inference-gateway-second-pass/main.py delete mode 120000 tests/test-inference-gateway-second-pass/model delete mode 100644 tests/test-inference-gateway-second-pass/xr.yaml delete mode 120000 tests/test-inference-gateway/lib delete mode 100644 tests/test-inference-gateway/main.py delete mode 120000 tests/test-inference-gateway/model delete mode 100644 tests/test-inference-gateway/xr.yaml delete mode 120000 tests/test-model-deployment-incompatible-cluster/lib delete mode 100644 tests/test-model-deployment-incompatible-cluster/main.py delete mode 120000 tests/test-model-deployment-incompatible-cluster/model delete mode 100644 tests/test-model-deployment-incompatible-cluster/xr.yaml delete mode 120000 tests/test-model-deployment-insufficient-nodes/lib delete mode 100644 tests/test-model-deployment-insufficient-nodes/main.py delete mode 120000 tests/test-model-deployment-insufficient-nodes/model delete mode 100644 tests/test-model-deployment-insufficient-nodes/xr.yaml delete mode 120000 tests/test-model-deployment-not-ready/lib delete mode 100644 tests/test-model-deployment-not-ready/main.py delete mode 120000 tests/test-model-deployment-not-ready/model delete mode 100644 tests/test-model-deployment-not-ready/xr.yaml delete mode 120000 tests/test-model-deployment-stable-scheduling/lib delete mode 100644 tests/test-model-deployment-stable-scheduling/main.py delete mode 120000 tests/test-model-deployment-stable-scheduling/model delete mode 100644 tests/test-model-deployment-stable-scheduling/xr.yaml delete mode 120000 tests/test-model-deployment/lib delete mode 100644 tests/test-model-deployment/main.py delete mode 120000 tests/test-model-deployment/model delete mode 100644 tests/test-model-deployment/xr.yaml delete mode 120000 tests/test-model-endpoint/lib delete mode 100644 tests/test-model-endpoint/main.py delete mode 120000 tests/test-model-endpoint/model delete mode 100644 tests/test-model-endpoint/xr.yaml delete mode 120000 tests/test-model-replica-multinode/lib delete mode 100644 tests/test-model-replica-multinode/main.py delete mode 120000 tests/test-model-replica-multinode/model delete mode 100644 tests/test-model-replica-multinode/xr.yaml delete mode 120000 tests/test-model-replica/lib delete mode 100644 tests/test-model-replica/main.py delete mode 120000 tests/test-model-replica/model delete mode 100644 tests/test-model-replica/xr.yaml delete mode 120000 tests/test-model-service/lib delete mode 100644 tests/test-model-service/main.py delete mode 120000 tests/test-model-service/model delete mode 100644 tests/test-model-service/xr.yaml delete mode 100644 upbound.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ba61b202..c1d9ca2d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: .#checks.x86_64-linux.nix-lint --print-build-logs - composition-tests: + unit-tests: runs-on: ubuntu-24.04 steps: @@ -49,7 +49,7 @@ jobs: push-package: if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: [lint, composition-tests] + needs: [lint, unit-tests] runs-on: ubuntu-24.04 steps: @@ -61,15 +61,8 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v31 - # action-up handles robot token auth for both the API and the - # registry. docker/login-action is also needed because up project - # push uses Docker's credential store for OCI pushes. - - name: Login to Upbound - uses: upbound/action-up@v1 - with: - api-token: ${{ secrets.UP_ROBOT_TOKEN }} - organization: modelplane - + # Authenticate with the registry using standard Docker credentials. + # The Crossplane CLI uses Docker's credential store for OCI pushes. - name: Login to registry uses: docker/login-action@v3 with: diff --git a/.gitignore b/.gitignore index bb63e6510..60791731a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ .venv +.venv-* _output .up +schemas/ result .direnv __pycache__/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e30f5f30..16e39e21d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,8 +5,8 @@ Modelplane uses [Nix](https://nixos.org) for builds, checks, and the development environment. If you have Nix installed, `nix develop` (or `direnv allow` if you use [direnv](https://direnv.net/)) drops you into a shell with -everything you need: `up`, `kubectl`, `helm`, `kind`, Python, Go, Node.js, -linters, and formatters. +everything you need: `crossplane`, `kubectl`, `helm`, `kind`, Python, linters, +and formatters. If you don't have Nix installed, [`nix.sh`](nix.sh) runs any Nix command inside a Docker container. The first run downloads dependencies into a Docker volume. @@ -22,16 +22,15 @@ nix develop ## Running checks -`nix flake check` runs all of the project's checks (tests, linters, formatters) -inside the Nix sandbox. Run `nix flake show` to see what's available. +`nix flake check` runs all of the project's checks (linters, formatters) inside +the Nix sandbox. Run `nix flake show` to see what's available. ```bash nix flake check # or: ./nix.sh flake check ``` -Composition tests run separately because they need Docker (the function-python -runtime runs in a container). These build the Crossplane project with `up project -build`, then run every test in `tests/`: +Unit tests build the Crossplane project with `crossplane project build` (to +generate Pydantic models), then run pytest: ```bash nix run .#test-crossplane # or: ./nix.sh run .#test-crossplane @@ -44,45 +43,49 @@ Run both before opening a PR. Modelplane is a [Crossplane](https://crossplane.io/) project. The core logic lives in Python composition functions under `functions/`. See [`skills/crossplane-python-functions/SKILL.md`](skills/crossplane-python-functions/SKILL.md) -for a detailed guide covering the function contract, build cycle, import paths, -resource composition, readiness tracking, gating, deletion ordering, and -debugging. There's also a complete -[example function](skills/crossplane-python-functions/references/example.py). - -The short version: each function has a `main.py` that exports a `compose(req, -rsp)` function. It reads the XR from the request, composes resources into the -response, and tracks readiness. Functions use generated Pydantic models (under -`.up/`) for type-safe access to XR specs and status, and shared utilities from -`lib/`. - -Build before you code. The Pydantic models are generated by `up project build` -(or `nix run .#build-crossplane`), so you need to build after changing an XRD -and before writing function code that imports the models. - -The shared library in `lib/` provides helpers for common patterns: Helm release -builders, Kubernetes object wrappers, condition management, secret handling, and -serving profile matching. If you find yourself duplicating logic across -functions, it probably belongs in `lib/`. +for a detailed guide. -### Tests +Each function is a self-contained Python package: + +``` +functions// + pyproject.toml # Declares deps on crossplane-models, modelplanelib, SDK + function/ + __init__.py + __version__.py + main.py # CLI entrypoint (boilerplate) + fn.py # FunctionRunner gRPC service (boilerplate) + compose.py # The actual composition logic +``` -Every function has at least one corresponding test in `tests/`. Tests are -Crossplane composition tests: they run a function against a mock XR and assert -the composed resources. +The `compose(req, rsp)` function in `compose.py` reads the XR from the request, +composes resources into the response, and tracks readiness. Functions use +generated Pydantic models (in `schemas/python/`) for type-safe access to XR +specs and status, and shared utilities from `lib/modelplanelib/`. -Each test directory has: +Build before you code. The Pydantic models are generated by `crossplane project +build` (or `nix run .#build-crossplane`), so you need to build after changing an +XRD and before writing function code that imports the models. + +Each function is self-contained — there is no shared library. Common patterns +like setting conditions, updating status, and building child resource names are +provided by the [Crossplane Python Function SDK](https://github.com/crossplane/function-sdk-python). +Helpers specific to a single function live in that function's `function/` +package. + +### Tests -- `main.py` defining the test (XR path, XRD path, composition path, extra - resources, and assertions) -- `xr.yaml` with the mock XR +Every function has at least one corresponding test in `tests/`. Tests are pytest +unit tests that call `compose(req, rsp)` directly with a +`RunFunctionRequest`/`RunFunctionResponse` pair and assert on the response. -Tests use `model_to_dict()` for assertions (what the output should look like) and -`model_to_fixture()` for extra resources (what the function reads as input). Both -are in `lib/resource.py`. +Tests use Pydantic models to build typed inputs (XRs, required resources) via +the `build_request()` helper in `tests/helpers.py`, and assert on the desired +resources, conditions, and status in the response. -To add a test, create a new directory under `tests/`, write an `xr.yaml`, and -write a `main.py` following the pattern in an existing test. Then run -`nix run .#test-crossplane` to verify it passes. +To add a test, add cases to the existing `tests/test_.py` file (or +create a new one for a new function). Then run `nix run .#test-crossplane` to +verify it passes. ## Submitting changes diff --git a/crossplane-project.yaml b/crossplane-project.yaml new file mode 100644 index 000000000..ca84229e0 --- /dev/null +++ b/crossplane-project.yaml @@ -0,0 +1,45 @@ +apiVersion: dev.crossplane.io/v1alpha1 +kind: Project +metadata: + name: modelplane +spec: + repository: xpkg.upbound.io/modelplane/modelplane + source: github.com/modelplaneai/modelplane + license: Apache-2.0 + description: An open-source AI inference platform built on Crossplane. + dependencies: + - type: crd + git: + repository: https://github.com/crossplane/crossplane + ref: release-2.2 + path: cluster/crds + - type: xpkg + xpkg: + apiVersion: pkg.crossplane.io/v1 + kind: Provider + package: xpkg.upbound.io/upbound/provider-gcp-container + version: v2.5.0 + - type: xpkg + xpkg: + apiVersion: pkg.crossplane.io/v1 + kind: Provider + package: xpkg.upbound.io/upbound/provider-gcp-compute + version: v2.5.0 + - type: xpkg + xpkg: + apiVersion: pkg.crossplane.io/v1 + kind: Provider + package: xpkg.upbound.io/upbound/provider-gcp-cloudplatform + version: v2.5.0 + - type: xpkg + xpkg: + apiVersion: pkg.crossplane.io/v1 + kind: Provider + package: xpkg.upbound.io/upbound/provider-helm + version: ">=v1.2.0" + - type: xpkg + xpkg: + apiVersion: pkg.crossplane.io/v1 + kind: Provider + package: xpkg.upbound.io/upbound/provider-kubernetes + version: ">=v1.2.0" diff --git a/docs/getting-started.md b/docs/getting-started.md index e623f8c72..659abbdbd 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -15,8 +15,8 @@ You need the following tools installed: - [kind](https://kind.sigs.k8s.io/) - [kubectl](https://kubernetes.io/docs/tasks/tools/) - [Helm](https://helm.sh/docs/intro/install/) -- The [Upbound CLI](https://docs.upbound.io/reference/cli/) (`up`), used to - create a pull secret for the Modelplane package registry. +- [Docker](https://www.docker.com/) (or a compatible credential helper) for + registry authentication. You also need: @@ -146,16 +146,16 @@ EOF Modelplane is packaged as a Crossplane [Configuration](https://docs.crossplane.io/latest/concepts/packages/#configuration-packages). -The package registry requires authentication. Create a pull secret using the -[Upbound CLI](https://docs.upbound.io/reference/cli/), then install the -Configuration. This pulls the providers and composition functions it depends on. - -`up ctp pull-secret create` uses the credentials of the currently active `up` -profile. Make sure you're logged in as a user account with access to the -`modelplane` organization (run `up login` if not). +The package registry requires authentication. Create a pull secret, then install +the Configuration. This pulls the providers and composition functions it depends +on. ```bash -up ctp pull-secret create -n crossplane-system upbound-pull-secret --organization modelplane +kubectl create secret docker-registry upbound-pull-secret \ + --docker-server=xpkg.upbound.io \ + --docker-username='' \ + --docker-password='' \ + -n crossplane-system ``` ```bash diff --git a/docs/pull-secret.yaml b/docs/pull-secret.yaml index d1b31b741..f9635dd88 100644 --- a/docs/pull-secret.yaml +++ b/docs/pull-secret.yaml @@ -1,11 +1,11 @@ # Pull secret for xpkg.upbound.io/modelplane/ packages. # -# The package registry requires authentication. Generate this secret using the -# Upbound CLI: +# The package registry requires authentication. Create a pull secret: # -# up ctp pull-secret create -n crossplane-system upbound-pull-secret --organization modelplane -# -# This creates a Kubernetes Secret with a 30-day session credential that grants -# read access to the modelplane organization's OCI packages. +# kubectl create secret docker-registry upbound-pull-secret \ +# --docker-server=xpkg.upbound.io \ +# --docker-username='' \ +# --docker-password='' \ +# -n crossplane-system # # Do not commit the generated secret to the repository. diff --git a/flake.lock b/flake.lock index b1da6fdfb..96d6b269f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,100 @@ { "nodes": { + "crossplane-cli": { + "inputs": { + "gomod2nix": "gomod2nix", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + }, + "locked": { + "lastModified": 1779303864, + "narHash": "sha256-XMcEJMCBKiE0UWn+ChGc6qibl0YJQoLNWFzH+QAZDqY=", + "owner": "crossplane", + "repo": "cli", + "rev": "bc595092600d24b56c506472d2731f4fa3cad333", + "type": "github" + }, + "original": { + "owner": "crossplane", + "repo": "cli", + "rev": "bc595092600d24b56c506472d2731f4fa3cad333", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gomod2nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "crossplane-cli", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770313987, + "narHash": "sha256-81QP51jUEgp2sOkGEXZ2TDsfbls98/A9aQTu7PAyP30=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "75c2866d585a75a1b30c634dbd7c2dcce5a6c3a7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "75c2866d585a75a1b30c634dbd7c2dcce5a6c3a7", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1776221942, + "narHash": "sha256-FbQAeVNi7G4v3QCSThrSAAvzQTmrmyDLiHNPvTF2qFM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1766437c5509f444c1b15331e82b8b6a9b967000", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1776255774, + "narHash": "sha256-psVTpH6PK3q1htMJpmdz1hLF5pQgEshu7gQWgKO6t6Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "566acc07c54dc807f91625bb286cb9b321b5f42a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1774244481, "narHash": "sha256-4XfMXU0DjN83o6HWZoKG9PegCvKvIhNUnRUI19vzTcQ=", @@ -18,7 +112,23 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "crossplane-cli": "crossplane-cli", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index d84709053..94f2beecd 100644 --- a/flake.nix +++ b/flake.nix @@ -6,10 +6,18 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + + # The Crossplane CLI, pinned to a specific commit. + # https://github.com/crossplane/cli + crossplane-cli.url = "github:crossplane/cli/bc595092600d24b56c506472d2731f4fa3cad333"; }; outputs = - { self, nixpkgs }: + { + self, + nixpkgs, + crossplane-cli, + }: let supportedSystems = [ "x86_64-linux" @@ -46,15 +54,16 @@ apps = forAllSystems ( { pkgs, system, ... }: let - build = import ./nix/build.nix { inherit pkgs self; }; + build = import ./nix/build.nix { inherit pkgs crossplane-cli; }; apps = import ./nix/apps.nix { inherit pkgs; }; - up = build.up { inherit system; }; + crossplane = build.crossplane { inherit system; }; dockerCredentialUp = build.dockerCredentialUp { inherit system; }; in { - build-crossplane = apps.buildCrossplane { inherit up dockerCredentialUp; }; - test-crossplane = apps.testCrossplane { inherit up dockerCredentialUp; }; - push-crossplane = apps.pushCrossplane { inherit up dockerCredentialUp; }; + build-crossplane = apps.buildCrossplane { inherit crossplane dockerCredentialUp; }; + test-crossplane = apps.testCrossplane { inherit crossplane dockerCredentialUp; }; + push-crossplane = apps.pushCrossplane { inherit crossplane dockerCredentialUp; }; + format = apps.format { }; lint = apps.lint { }; } ); @@ -63,15 +72,15 @@ devShells = forAllSystems ( { pkgs, system, ... }: let - build = import ./nix/build.nix { inherit pkgs self; }; - up = build.up { inherit system; }; + build = import ./nix/build.nix { inherit pkgs crossplane-cli; }; + crossplane = build.crossplane { inherit system; }; dockerCredentialUp = build.dockerCredentialUp { inherit system; }; in { default = pkgs.mkShell { buildInputs = [ - # Crossplane / Upbound - up + # Crossplane + crossplane dockerCredentialUp # Kubernetes @@ -80,7 +89,7 @@ pkgs.kind pkgs.docker-client - # Python (for linting composition functions) + # Python (for linting and testing composition functions) pkgs.python3 pkgs.ruff pkgs.pyright @@ -100,9 +109,9 @@ echo "Modelplane development shell" echo "" - echo " nix run .#build-crossplane nix run .#lint" - echo " nix run .#test-crossplane nix flake check" - echo " nix run .#push-crossplane nix flake show" + echo " nix run .#build-crossplane nix run .#format" + echo " nix run .#test-crossplane nix run .#lint" + echo " nix run .#push-crossplane nix flake check" echo "" ''; }; diff --git a/lib/__init__.py b/functions/compose-gke-cluster/function/__init__.py similarity index 100% rename from lib/__init__.py rename to functions/compose-gke-cluster/function/__init__.py diff --git a/functions/compose-gke-cluster/function/__version__.py b/functions/compose-gke-cluster/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-gke-cluster/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-gke-cluster/main.py b/functions/compose-gke-cluster/function/fn.py similarity index 80% rename from functions/compose-gke-cluster/main.py rename to functions/compose-gke-cluster/function/fn.py index 59cad33c3..b88c7f3d3 100644 --- a/functions/compose-gke-cluster/main.py +++ b/functions/compose-gke-cluster/function/fn.py @@ -6,24 +6,23 @@ and provider-helm to reach the cluster. """ -from crossplane.function import resource +import grpc +from crossplane.function import logging, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -from .lib import conditions, metadata, naming, secrets -from .lib import resource as libresource -from .model.ai.modelplane.infrastructure.gkecluster import v1alpha1 -from .model.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 -from .model.io.crossplane.m.kubernetes.providerconfig import v1alpha1 as k8spcv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.m.gcp.cloudplatform.projectiammember import v1beta1 as iamv1beta1 -from .model.io.upbound.m.gcp.cloudplatform.serviceaccount import v1beta1 as sav1beta1 -from .model.io.upbound.m.gcp.cloudplatform.serviceaccountkey import ( +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.infrastructure.gkecluster import v1alpha1 +from models.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 +from models.io.crossplane.m.kubernetes.providerconfig import v1alpha1 as k8spcv1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 +from models.io.upbound.m.gcp.cloudplatform.projectiammember import v1beta1 as iamv1beta1 +from models.io.upbound.m.gcp.cloudplatform.serviceaccount import v1beta1 as sav1beta1 +from models.io.upbound.m.gcp.cloudplatform.serviceaccountkey import ( v1beta1 as sakeyv1beta1, ) -from .model.io.upbound.m.gcp.compute.network import v1beta1 as networkv1beta1 -from .model.io.upbound.m.gcp.compute.subnetwork import v1beta1 as subnetv1beta1 -from .model.io.upbound.m.gcp.container.cluster import v1beta1 as clusterv1beta1 -from .model.io.upbound.m.gcp.container.nodepool import v1beta1 as nodepoolv1beta1 +from models.io.upbound.m.gcp.compute.network import v1beta1 as networkv1beta1 +from models.io.upbound.m.gcp.compute.subnetwork import v1beta1 as subnetv1beta1 +from models.io.upbound.m.gcp.container.cluster import v1beta1 as clusterv1beta1 +from models.io.upbound.m.gcp.container.nodepool import v1beta1 as nodepoolv1beta1 # Subnet secondary range names. These couple the subnet definition to # the cluster's ipAllocationPolicy — both must use the same names. @@ -39,15 +38,54 @@ _SYSTEM_POOL_MIN_NODE_COUNT = 1 _SYSTEM_POOL_MAX_NODE_COUNT = 2 +# Labels written on GKE node pools. compose-model-deployment reads +# these labels for GPU scheduling. +_LABEL_GPU = "modelplane.ai/gpu" +_LABEL_POOL = "modelplane.ai/pool" + +# Secret types written to XR status. compose-inference-cluster reads +# these to wire the kubeconfig and SA key into ProviderConfigs. +_SECRET_TYPE_KUBECONFIG = "Kubeconfig" +_SECRET_TYPE_GCP_SA_KEY = "GCPServiceAccountKey" + +# Secret keys within the Kubernetes Secrets created by GCP providers. +_SECRET_KEY_KUBECONFIG = "kubeconfig" +_SECRET_KEY_GCP_SA = "private_key" + +# Identity type for GCP service account credentials. +_IDENTITY_TYPE_GCP = "GoogleApplicationCredentials" + +# GKE node configuration. +_GKE_IMAGE_TYPE = "COS_CONTAINERD" +_GKE_OAUTH_SCOPE = "https://www.googleapis.com/auth/cloud-platform" + def _kubeconfig_secret_name(xr): """Derive the kubeconfig secret name from the XR.""" - return naming.dns_name(xr.metadata.name, "kubeconfig") + return resource.child_name(xr.metadata.name, "kubeconfig") def _sa_key_secret_name(xr): """Derive the SA key secret name from the XR.""" - return naming.dns_name(xr.metadata.name, "sa-key") + return resource.child_name(xr.metadata.name, "sa-key") + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp class Composer: @@ -152,10 +190,8 @@ def compose_node_pools(self): node_config = nodepoolv1beta1.NodeConfig( machineType=pool.machineType, diskSizeGb=pool.diskSizeGb, - imageType="COS_CONTAINERD", - oauthScopes=[ - "https://www.googleapis.com/auth/cloud-platform", - ], + imageType=_GKE_IMAGE_TYPE, + oauthScopes=[_GKE_OAUTH_SCOPE], ) if pool.role == "GPU" and pool.gpu: @@ -169,12 +205,12 @@ def compose_node_pools(self): ), ] node_config.labels = { - metadata.LABEL_KEY_GPU: pool.gpu.acceleratorType, - metadata.LABEL_KEY_POOL: pool.name, + _LABEL_GPU: pool.gpu.acceleratorType, + _LABEL_POOL: pool.name, } else: node_config.labels = { - metadata.LABEL_KEY_POOL: pool.name, + _LABEL_POOL: pool.name, } np = nodepoolv1beta1.NodePool( @@ -222,12 +258,10 @@ def _compose_system_pool(self): ), nodeConfig=nodepoolv1beta1.NodeConfig( machineType=_SYSTEM_POOL_MACHINE_TYPE, - imageType="COS_CONTAINERD", - oauthScopes=[ - "https://www.googleapis.com/auth/cloud-platform", - ], + imageType=_GKE_IMAGE_TYPE, + oauthScopes=[_GKE_OAUTH_SCOPE], labels={ - metadata.LABEL_KEY_POOL: _SYSTEM_POOL_NAME, + _LABEL_POOL: _SYSTEM_POOL_NAME, }, ), ), @@ -296,16 +330,16 @@ def compose_provider_configs(self): secretRef=k8spcv1alpha1.SecretRef( name=_kubeconfig_secret_name(self.xr), namespace=self.xr.metadata.namespace, - key=secrets.SECRET_KEY_KUBECONFIG, + key=_SECRET_KEY_KUBECONFIG, ), ), identity=k8spcv1alpha1.Identity( - type="GoogleApplicationCredentials", + type=_IDENTITY_TYPE_GCP, source="Secret", secretRef=k8spcv1alpha1.SecretRef( name=_sa_key_secret_name(self.xr), namespace=self.xr.metadata.namespace, - key=secrets.SECRET_KEY_GCP_SA, + key=_SECRET_KEY_GCP_SA, ), ), ), @@ -322,16 +356,16 @@ def compose_provider_configs(self): secretRef=helmpcv1beta1.SecretRef( name=_kubeconfig_secret_name(self.xr), namespace=self.xr.metadata.namespace, - key=secrets.SECRET_KEY_KUBECONFIG, + key=_SECRET_KEY_KUBECONFIG, ), ), identity=helmpcv1beta1.Identity( - type="GoogleApplicationCredentials", + type=_IDENTITY_TYPE_GCP, source="Secret", secretRef=helmpcv1beta1.SecretRef( name=_sa_key_secret_name(self.xr), namespace=self.xr.metadata.namespace, - key=secrets.SECRET_KEY_GCP_SA, + key=_SECRET_KEY_GCP_SA, ), ), ), @@ -339,19 +373,19 @@ def compose_provider_configs(self): ) def write_status(self): - libresource.update_status( + resource.update_status( self.rsp.desired.composite, v1alpha1.Status( secrets=[ v1alpha1.Secret( - type=secrets.SECRET_TYPE_KUBECONFIG, + type=_SECRET_TYPE_KUBECONFIG, name=_kubeconfig_secret_name(self.xr), - key=secrets.SECRET_KEY_KUBECONFIG, + key=_SECRET_KEY_KUBECONFIG, ), v1alpha1.Secret( - type=secrets.SECRET_TYPE_GCP_SA_KEY, + type=_SECRET_TYPE_GCP_SA_KEY, name=_sa_key_secret_name(self.xr), - key=secrets.SECRET_KEY_GCP_SA, + key=_SECRET_KEY_GCP_SA, ), ], ), @@ -372,7 +406,7 @@ def mark_readiness(self): managed_resources.append("iam-binding") for r in managed_resources: - if conditions.has_condition(self.req, r, "Ready"): + if resource.get_condition(self.req.observed.resources.get(r), "Ready").status == "True": self.rsp.desired.resources[r].ready = fnv1.READY_TRUE self.rsp.desired.resources["provider-config-kubernetes"].ready = fnv1.READY_TRUE @@ -387,8 +421,3 @@ def observed_sa_email(self): if not sa.status or not sa.status.atProvider: return None return sa.status.atProvider.email - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose a GKE cluster and all supporting GCP resources.""" - Composer(req, rsp).compose() diff --git a/functions/compose-gke-cluster/function/main.py b/functions/compose-gke-cluster/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-gke-cluster/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-gke-cluster/lib b/functions/compose-gke-cluster/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-gke-cluster/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-gke-cluster/model b/functions/compose-gke-cluster/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-gke-cluster/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-gke-cluster/pyproject.toml b/functions/compose-gke-cluster/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-gke-cluster/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-gke-cluster/tests/__init__.py b/functions/compose-gke-cluster/tests/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/functions/compose-gke-cluster/tests/__init__.py @@ -0,0 +1 @@ + diff --git a/functions/compose-gke-cluster/tests/test_fn.py b/functions/compose-gke-cluster/tests/test_fn.py new file mode 100644 index 000000000..d43580a85 --- /dev/null +++ b/functions/compose-gke-cluster/tests/test_fn.py @@ -0,0 +1,669 @@ +"""Tests for the compose-gke-cluster function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.infrastructure.gkecluster import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-gke-cluster.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function composes GKE cluster infrastructure.""" + cases = [ + Case( + name="first pass composes infra resources; IAM binding gated", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.GKECluster( + metadata=metav1.ObjectMeta( + name="test-cluster", + namespace="modelplane-system", + ), + spec=v1alpha1.Spec( + project="my-gcp-project", + region="us-central1", + nodePools=[ + v1alpha1.NodePool( + name="gpu-pool", + role="GPU", + machineType="a2-highgpu-8g", + gpu=v1alpha1.Gpu( + acceleratorType="nvidia-tesla-a100", + acceleratorCount=8, + memory="80Gi", + ), + ), + ], + ), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + { + "status": { + "secrets": [ + { + "type": "Kubeconfig", + "name": "test-cluster-kubeconfig-55b57", + "key": "kubeconfig", + }, + { + "type": "GCPServiceAccountKey", + "name": "test-cluster-sa-key-3295c", + "key": "private_key", + }, + ], + }, + } + ), + ), + resources={ + "network": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "compute.gcp.m.upbound.io/v1beta1", + "kind": "Network", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "autoCreateSubnetworks": False, + }, + }, + } + ), + ), + "subnet": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "compute.gcp.m.upbound.io/v1beta1", + "kind": "Subnetwork", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "region": "us-central1", + "networkSelector": {"matchControllerRef": True}, + "ipCidrRange": "10.0.0.0/24", + "secondaryIpRange": [ + {"rangeName": "pods", "ipCidrRange": "10.1.0.0/16"}, + {"rangeName": "services", "ipCidrRange": "10.2.0.0/16"}, + ], + }, + }, + } + ), + ), + "cluster": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "container.gcp.m.upbound.io/v1beta1", + "kind": "Cluster", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "location": "us-central1", + "deletionProtection": False, + "removeDefaultNodePool": True, + "initialNodeCount": 1, + "minMasterVersion": "1.35", + "networkSelector": {"matchControllerRef": True}, + "subnetworkSelector": {"matchControllerRef": True}, + "ipAllocationPolicy": { + "clusterSecondaryRangeName": "pods", + "servicesSecondaryRangeName": "services", + }, + "releaseChannel": {"channel": "REGULAR"}, + "workloadIdentityConfig": { + "workloadPool": "my-gcp-project.svc.id.goog", + }, + }, + "writeConnectionSecretToRef": { + "name": "test-cluster-kubeconfig-55b57", + }, + }, + } + ), + ), + "nodepool-system": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "container.gcp.m.upbound.io/v1beta1", + "kind": "NodePool", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "location": "us-central1", + "clusterSelector": {"matchControllerRef": True}, + "initialNodeCount": 1, + "autoscaling": {"minNodeCount": 1, "maxNodeCount": 2}, + "nodeConfig": { + "machineType": "e2-standard-4", + "imageType": "COS_CONTAINERD", + "oauthScopes": [ + "https://www.googleapis.com/auth/cloud-platform", + ], + "labels": {"modelplane.ai/pool": "system"}, + }, + }, + }, + } + ), + ), + "nodepool-gpu-pool": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "container.gcp.m.upbound.io/v1beta1", + "kind": "NodePool", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "location": "us-central1", + "clusterSelector": {"matchControllerRef": True}, + "initialNodeCount": 1, + "autoscaling": {"minNodeCount": 0, "maxNodeCount": 8}, + "nodeConfig": { + "machineType": "a2-highgpu-8g", + "diskSizeGb": 100, + "imageType": "COS_CONTAINERD", + "oauthScopes": [ + "https://www.googleapis.com/auth/cloud-platform", + ], + "guestAccelerator": [ + { + "type": "nvidia-tesla-a100", + "count": 8, + "gpuDriverInstallationConfig": { + "gpuDriverVersion": "DEFAULT", + }, + }, + ], + "labels": { + "modelplane.ai/gpu": "nvidia-tesla-a100", + "modelplane.ai/pool": "gpu-pool", + }, + }, + }, + }, + } + ), + ), + "service-account": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "cloudplatform.gcp.m.upbound.io/v1beta1", + "kind": "ServiceAccount", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "displayName": "Crossplane GKECluster test-cluster", + }, + }, + } + ), + ), + "service-account-key": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "cloudplatform.gcp.m.upbound.io/v1beta1", + "kind": "ServiceAccountKey", + "spec": { + "forProvider": { + "serviceAccountIdSelector": {"matchControllerRef": True}, + }, + "writeConnectionSecretToRef": { + "name": "test-cluster-sa-key-3295c", + }, + }, + } + ), + ), + "provider-config-kubernetes": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "ProviderConfig", + "metadata": {"name": "test-cluster-kubeconfig-55b57"}, + "spec": { + "credentials": { + "source": "Secret", + "secretRef": { + "name": "test-cluster-kubeconfig-55b57", + "namespace": "modelplane-system", + "key": "kubeconfig", + }, + }, + "identity": { + "type": "GoogleApplicationCredentials", + "source": "Secret", + "secretRef": { + "name": "test-cluster-sa-key-3295c", + "namespace": "modelplane-system", + "key": "private_key", + }, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "metadata": {"name": "test-cluster-kubeconfig-55b57"}, + "spec": { + "credentials": { + "source": "Secret", + "secretRef": { + "name": "test-cluster-kubeconfig-55b57", + "namespace": "modelplane-system", + "key": "kubeconfig", + }, + }, + "identity": { + "type": "GoogleApplicationCredentials", + "source": "Secret", + "secretRef": { + "name": "test-cluster-sa-key-3295c", + "namespace": "modelplane-system", + "key": "private_key", + }, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + }, + ), + context=structpb.Struct(), + ), + ), + Case( + name="second pass with observed SA email composes IAM binding and marks ready resources", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.GKECluster( + metadata=metav1.ObjectMeta( + name="test-cluster", + namespace="modelplane-system", + ), + spec=v1alpha1.Spec( + project="my-gcp-project", + region="us-central1", + nodePools=[ + v1alpha1.NodePool( + name="gpu-pool", + role="GPU", + machineType="a2-highgpu-8g", + gpu=v1alpha1.Gpu( + acceleratorType="nvidia-tesla-a100", + acceleratorCount=8, + memory="80Gi", + ), + ), + ], + ), + ).model_dump(exclude_none=True, mode="json") + ), + ), + resources={ + "service-account": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "cloudplatform.gcp.m.upbound.io/v1beta1", + "kind": "ServiceAccount", + "spec": { + "forProvider": {"project": "my-gcp-project"}, + }, + "status": { + "atProvider": { + "email": "test-sa@my-gcp-project.iam.gserviceaccount.com", + }, + "conditions": [ + { + "type": "Ready", + "status": "True", + "reason": "Available", + "lastTransitionTime": "2024-01-01T00:00:00Z", + }, + ], + }, + } + ), + ), + "network": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "compute.gcp.m.upbound.io/v1beta1", + "kind": "Network", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "autoCreateSubnetworks": False, + }, + }, + "status": { + "conditions": [ + { + "type": "Ready", + "status": "True", + "reason": "Available", + "lastTransitionTime": "2024-01-01T00:00:00Z", + }, + ], + }, + } + ), + ), + }, + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + { + "status": { + "secrets": [ + { + "type": "Kubeconfig", + "name": "test-cluster-kubeconfig-55b57", + "key": "kubeconfig", + }, + { + "type": "GCPServiceAccountKey", + "name": "test-cluster-sa-key-3295c", + "key": "private_key", + }, + ], + }, + } + ), + ), + resources={ + "network": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "compute.gcp.m.upbound.io/v1beta1", + "kind": "Network", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "autoCreateSubnetworks": False, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "subnet": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "compute.gcp.m.upbound.io/v1beta1", + "kind": "Subnetwork", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "region": "us-central1", + "networkSelector": {"matchControllerRef": True}, + "ipCidrRange": "10.0.0.0/24", + "secondaryIpRange": [ + {"rangeName": "pods", "ipCidrRange": "10.1.0.0/16"}, + {"rangeName": "services", "ipCidrRange": "10.2.0.0/16"}, + ], + }, + }, + } + ), + ), + "cluster": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "container.gcp.m.upbound.io/v1beta1", + "kind": "Cluster", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "location": "us-central1", + "deletionProtection": False, + "removeDefaultNodePool": True, + "initialNodeCount": 1, + "minMasterVersion": "1.35", + "networkSelector": {"matchControllerRef": True}, + "subnetworkSelector": {"matchControllerRef": True}, + "ipAllocationPolicy": { + "clusterSecondaryRangeName": "pods", + "servicesSecondaryRangeName": "services", + }, + "releaseChannel": {"channel": "REGULAR"}, + "workloadIdentityConfig": { + "workloadPool": "my-gcp-project.svc.id.goog", + }, + }, + "writeConnectionSecretToRef": { + "name": "test-cluster-kubeconfig-55b57", + }, + }, + } + ), + ), + "nodepool-system": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "container.gcp.m.upbound.io/v1beta1", + "kind": "NodePool", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "location": "us-central1", + "clusterSelector": {"matchControllerRef": True}, + "initialNodeCount": 1, + "autoscaling": {"minNodeCount": 1, "maxNodeCount": 2}, + "nodeConfig": { + "machineType": "e2-standard-4", + "imageType": "COS_CONTAINERD", + "oauthScopes": [ + "https://www.googleapis.com/auth/cloud-platform", + ], + "labels": {"modelplane.ai/pool": "system"}, + }, + }, + }, + } + ), + ), + "nodepool-gpu-pool": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "container.gcp.m.upbound.io/v1beta1", + "kind": "NodePool", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "location": "us-central1", + "clusterSelector": {"matchControllerRef": True}, + "initialNodeCount": 1, + "autoscaling": {"minNodeCount": 0, "maxNodeCount": 8}, + "nodeConfig": { + "machineType": "a2-highgpu-8g", + "diskSizeGb": 100, + "imageType": "COS_CONTAINERD", + "oauthScopes": [ + "https://www.googleapis.com/auth/cloud-platform", + ], + "guestAccelerator": [ + { + "type": "nvidia-tesla-a100", + "count": 8, + "gpuDriverInstallationConfig": { + "gpuDriverVersion": "DEFAULT", + }, + }, + ], + "labels": { + "modelplane.ai/gpu": "nvidia-tesla-a100", + "modelplane.ai/pool": "gpu-pool", + }, + }, + }, + }, + } + ), + ), + "service-account": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "cloudplatform.gcp.m.upbound.io/v1beta1", + "kind": "ServiceAccount", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "displayName": "Crossplane GKECluster test-cluster", + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "service-account-key": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "cloudplatform.gcp.m.upbound.io/v1beta1", + "kind": "ServiceAccountKey", + "spec": { + "forProvider": { + "serviceAccountIdSelector": {"matchControllerRef": True}, + }, + "writeConnectionSecretToRef": { + "name": "test-cluster-sa-key-3295c", + }, + }, + } + ), + ), + "iam-binding": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "cloudplatform.gcp.m.upbound.io/v1beta1", + "kind": "ProjectIAMMember", + "spec": { + "forProvider": { + "project": "my-gcp-project", + "role": "roles/container.admin", + "member": "serviceAccount:test-sa@my-gcp-project.iam.gserviceaccount.com", # noqa: E501 + }, + }, + } + ), + ), + "provider-config-kubernetes": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "ProviderConfig", + "metadata": {"name": "test-cluster-kubeconfig-55b57"}, + "spec": { + "credentials": { + "source": "Secret", + "secretRef": { + "name": "test-cluster-kubeconfig-55b57", + "namespace": "modelplane-system", + "key": "kubeconfig", + }, + }, + "identity": { + "type": "GoogleApplicationCredentials", + "source": "Secret", + "secretRef": { + "name": "test-cluster-sa-key-3295c", + "namespace": "modelplane-system", + "key": "private_key", + }, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "metadata": {"name": "test-cluster-kubeconfig-55b57"}, + "spec": { + "credentials": { + "source": "Secret", + "secretRef": { + "name": "test-cluster-kubeconfig-55b57", + "namespace": "modelplane-system", + "key": "kubeconfig", + }, + }, + "identity": { + "type": "GoogleApplicationCredentials", + "source": "Secret", + "secretRef": { + "name": "test-cluster-sa-key-3295c", + "namespace": "modelplane-system", + "key": "private_key", + }, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + }, + ), + context=structpb.Struct(), + ), + ), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/tests/.gitkeep b/functions/compose-inference-class/function/__init__.py similarity index 100% rename from tests/.gitkeep rename to functions/compose-inference-class/function/__init__.py diff --git a/functions/compose-inference-class/function/__version__.py b/functions/compose-inference-class/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-inference-class/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-inference-class/function/fn.py b/functions/compose-inference-class/function/fn.py new file mode 100644 index 000000000..fd56e030e --- /dev/null +++ b/functions/compose-inference-class/function/fn.py @@ -0,0 +1,35 @@ +"""Compose an InferenceClass. + +InferenceClass is a data resource: it describes hardware (resources) +and optionally how to provision it (provisioning). It has no composed +children. This function just marks the XR Ready. +""" + +import grpc +from crossplane.function import logging, resource, response +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.inferenceclass import v1alpha1 + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + + _ = v1alpha1.InferenceClass(**resource.struct_to_dict(req.observed.composite.resource)) + + resource.update_status(rsp.desired.composite, v1alpha1.Status()) + response.set_conditions(rsp, resource.Condition(typ="Accepted", status="True", reason="Available")) + rsp.desired.composite.ready = fnv1.READY_TRUE + + return rsp diff --git a/functions/compose-inference-class/function/main.py b/functions/compose-inference-class/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-inference-class/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-inference-class/lib b/functions/compose-inference-class/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-inference-class/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-inference-class/main.py b/functions/compose-inference-class/main.py deleted file mode 100644 index b1cadd1c1..000000000 --- a/functions/compose-inference-class/main.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Compose an InferenceClass. - -InferenceClass is a data resource: it describes hardware (resources) -and optionally how to provision it (provisioning). It has no composed -children. This function just marks the XR Ready. -""" - -from crossplane.function import resource -from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -from .lib import conditions -from .lib import resource as libresource -from .model.ai.modelplane.inferenceclass import v1alpha1 - -CONDITION_TYPE_ACCEPTED = "Accepted" -CONDITION_REASON_AVAILABLE = "Available" - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Mark the InferenceClass Ready. No resources are composed.""" - _ = v1alpha1.InferenceClass(**resource.struct_to_dict(req.observed.composite.resource)) - - libresource.update_status(rsp.desired.composite, v1alpha1.Status()) - conditions.set_condition(rsp, CONDITION_TYPE_ACCEPTED, True, CONDITION_REASON_AVAILABLE) - rsp.desired.composite.ready = fnv1.READY_TRUE diff --git a/functions/compose-inference-class/model b/functions/compose-inference-class/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-inference-class/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-inference-class/pyproject.toml b/functions/compose-inference-class/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-inference-class/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-inference-class/tests/__init__.py b/functions/compose-inference-class/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-inference-class/tests/test_fn.py b/functions/compose-inference-class/tests/test_fn.py new file mode 100644 index 000000000..adc5ebadd --- /dev/null +++ b/functions/compose-inference-class/tests/test_fn.py @@ -0,0 +1,84 @@ +"""Tests for the compose-inference-class function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.inferenceclass import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-inference-class.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function marks the InferenceClass as ready.""" + cases = [ + Case( + name="marks XR ready with Accepted condition and empty status", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.InferenceClass( + metadata=metav1.ObjectMeta(name="gpu-l4"), + spec=v1alpha1.Spec( + resources=v1alpha1.Resources( + gpu=v1alpha1.Gpu(count=1, memory="24Gi"), + ), + ), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {}}), + ready=fnv1.READY_TRUE, + ), + ), + conditions=[ + fnv1.Condition( + type="Accepted", + status=fnv1.STATUS_CONDITION_TRUE, + reason="Available", + ), + ], + context=structpb.Struct(), + ), + ), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/functions/compose-inference-cluster/function/__init__.py b/functions/compose-inference-cluster/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-inference-cluster/function/__version__.py b/functions/compose-inference-cluster/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-inference-cluster/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-inference-cluster/main.py b/functions/compose-inference-cluster/function/fn.py similarity index 78% rename from functions/compose-inference-cluster/main.py rename to functions/compose-inference-cluster/function/fn.py index c0f4cd76e..f06da52b2 100644 --- a/functions/compose-inference-cluster/main.py +++ b/functions/compose-inference-cluster/function/fn.py @@ -15,20 +15,19 @@ The system pool is not exposed in the user-facing API. """ -from crossplane.function import request, resource, response +import grpc +from crossplane.function import logging, request, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -from .lib import conditions, metadata, naming, secrets -from .lib import resource as libresource -from .model.ai.modelplane.inferenceclass import v1alpha1 as iclv1alpha1 -from .model.ai.modelplane.inferencecluster import v1alpha1 -from .model.ai.modelplane.infrastructure.gkecluster import v1alpha1 as gkev1alpha1 -from .model.ai.modelplane.infrastructure.kservebackend import v1alpha1 as kssv1alpha1 -from .model.io.crossplane.m.kubernetes.clusterproviderconfig import ( +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.inferenceclass import v1alpha1 as iclv1alpha1 +from models.ai.modelplane.inferencecluster import v1alpha1 +from models.ai.modelplane.infrastructure.gkecluster import v1alpha1 as gkev1alpha1 +from models.ai.modelplane.infrastructure.kservebackend import v1alpha1 as kssv1alpha1 +from models.io.crossplane.m.kubernetes.clusterproviderconfig import ( v1alpha1 as k8scpcv1alpha1, ) -from .model.io.crossplane.protection.usage import v1beta1 as usagev1beta1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 +from models.io.crossplane.protection.usage import v1beta1 as usagev1beta1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 # KServe version installed on remote clusters. Hardcoded as an internal # implementation detail — users don't choose or see this. @@ -53,6 +52,36 @@ # Composed resource key for the backend XR. BACKEND_RESOURCE_KEY = "kserve-backend" +# Secret types that couple compose-gke-cluster (writer) to this function +# (reader) and compose-kserve-backend (reader). +_SECRET_TYPE_KUBECONFIG = "Kubeconfig" +_SECRET_TYPE_GCP_SA_KEY = "GCPServiceAccountKey" + +# The modelplane-system namespace. Used for the KServeBackend XR, +# ClusterProviderConfig secretRefs, and status.namespace. +_NAMESPACE_SYSTEM = "modelplane-system" + +# Identity type for GCP service account credentials. +_IDENTITY_TYPE_GCP = "GoogleApplicationCredentials" + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp + class Composer: def __init__(self, req, rsp): @@ -105,12 +134,14 @@ def resolve_classes(self) -> bool: self.classes[name] = iclv1alpha1.InferenceClass.model_validate(d) if missing: - conditions.set_condition( + response.set_conditions( self.rsp, - CONDITION_TYPE_CLUSTER_READY, - False, - CONDITION_REASON_WAITING_FOR_CLASSES, - f"Waiting for InferenceClasses: {', '.join(missing)}", + resource.Condition( + typ=CONDITION_TYPE_CLUSTER_READY, + status="False", + reason=CONDITION_REASON_WAITING_FOR_CLASSES, + message=f"Waiting for InferenceClasses: {', '.join(missing)}", + ), ) response.normal(self.rsp, f"Waiting for InferenceClasses: {', '.join(missing)}") return False @@ -127,9 +158,9 @@ def compose_gke(self, gke): self.compose_gke_cluster(gke) - gke_ready = conditions.has_condition(self.req, "gke-cluster", "Ready") - kubeconfig = self.observed_gke_secret(secrets.SECRET_TYPE_KUBECONFIG) - sa_key = self.observed_gke_secret(secrets.SECRET_TYPE_GCP_SA_KEY) + gke_ready = resource.get_condition(self.req.observed.resources.get("gke-cluster"), "Ready").status == "True" + kubeconfig = self.observed_gke_secret(_SECRET_TYPE_KUBECONFIG) + sa_key = self.observed_gke_secret(_SECRET_TYPE_GCP_SA_KEY) cpc_exists = "cluster-provider-config-kubernetes" in self.req.observed.resources backend_exists = BACKEND_RESOURCE_KEY in self.req.observed.resources @@ -166,13 +197,11 @@ def compose_existing(self, existing): self.compose_cluster_provider_config(existing.secretRef.name, existing.secretRef.key, sa_key=identity) backend_secrets = [ - kssv1alpha1.Secret( - type=secrets.SECRET_TYPE_KUBECONFIG, name=existing.secretRef.name, key=existing.secretRef.key - ), + kssv1alpha1.Secret(type=_SECRET_TYPE_KUBECONFIG, name=existing.secretRef.name, key=existing.secretRef.key), ] if identity: backend_secrets.append( - kssv1alpha1.Secret(type=secrets.SECRET_TYPE_GCP_SA_KEY, name=identity.name, key=identity.key), + kssv1alpha1.Secret(type=_SECRET_TYPE_GCP_SA_KEY, name=identity.name, key=identity.key), ) self.compose_kserve_backend(backend_secrets) @@ -185,8 +214,8 @@ def compose_kserve_backend(self, backend_secrets: list[kssv1alpha1.Secret]): self.rsp.desired.resources[BACKEND_RESOURCE_KEY], kssv1alpha1.KServeBackend( metadata=metav1.ObjectMeta( - name=naming.dns_name(self.xr.metadata.name, "kserve"), - namespace=metadata.NAMESPACE_SYSTEM, + name=resource.child_name(self.xr.metadata.name, "kserve"), + namespace=_NAMESPACE_SYSTEM, ), spec=kssv1alpha1.Spec( versions=kssv1alpha1.Versions(kserve=KSERVE_VERSION), @@ -199,12 +228,12 @@ def compose_cluster_provider_config(self, kubeconfig_name, kubeconfig_key, sa_ke """Compose a ClusterProviderConfig for provider-kubernetes so that ModelReplicas can create Objects on the remote cluster.""" cpc = k8scpcv1alpha1.ClusterProviderConfig( - metadata=metav1.ObjectMeta(name=naming.dns_name(self.xr.metadata.name, "cluster-kubeconfig")), + metadata=metav1.ObjectMeta(name=resource.child_name(self.xr.metadata.name, "cluster-kubeconfig")), spec=k8scpcv1alpha1.Spec( credentials=k8scpcv1alpha1.Credentials( source="Secret", secretRef=k8scpcv1alpha1.SecretRef( - namespace=metadata.NAMESPACE_SYSTEM, + namespace=_NAMESPACE_SYSTEM, name=kubeconfig_name, key=kubeconfig_key, ), @@ -213,10 +242,10 @@ def compose_cluster_provider_config(self, kubeconfig_name, kubeconfig_key, sa_ke ) if sa_key: cpc.spec.identity = k8scpcv1alpha1.Identity( - type="GoogleApplicationCredentials", + type=_IDENTITY_TYPE_GCP, source="Secret", secretRef=k8scpcv1alpha1.SecretRef( - namespace=metadata.NAMESPACE_SYSTEM, + namespace=_NAMESPACE_SYSTEM, name=sa_key.name, key=sa_key.key, ), @@ -231,9 +260,9 @@ def write_status(self, gpu_pools): """Write the InferenceCluster status.""" status = v1alpha1.Status( providerConfigRef=v1alpha1.ProviderConfigRef( - name=naming.dns_name(self.xr.metadata.name, "cluster-kubeconfig"), + name=resource.child_name(self.xr.metadata.name, "cluster-kubeconfig"), ), - namespace=metadata.NAMESPACE_SYSTEM, + namespace=_NAMESPACE_SYSTEM, capacity=v1alpha1.Capacity( gpuPools=gpu_pools, ), @@ -241,19 +270,23 @@ def write_status(self, gpu_pools): gateway_address = self.observed_gateway_address() if gateway_address: status.gateway = v1alpha1.Gateway(address=gateway_address) - libresource.update_status(self.rsp.desired.composite, status) + resource.update_status(self.rsp.desired.composite, status) def derive_conditions(self, cluster_ready): """Derive ClusterReady and BackendReady conditions.""" - backend_ready = conditions.has_condition(self.req, BACKEND_RESOURCE_KEY, "Ready") + backend_ready = ( + resource.get_condition(self.req.observed.resources.get(BACKEND_RESOURCE_KEY), "Ready").status == "True" + ) if BACKEND_RESOURCE_KEY in self.rsp.desired.resources and backend_ready: self.rsp.desired.resources[BACKEND_RESOURCE_KEY].ready = fnv1.READY_TRUE - conditions.set_condition( + response.set_conditions( self.rsp, - CONDITION_TYPE_CLUSTER_READY, - cluster_ready, - CONDITION_REASON_CLUSTER_RUNNING if cluster_ready else CONDITION_REASON_PROVISIONING, + resource.Condition( + typ=CONDITION_TYPE_CLUSTER_READY, + status="True" if cluster_ready else "False", + reason=CONDITION_REASON_CLUSTER_RUNNING if cluster_ready else CONDITION_REASON_PROVISIONING, + ), ) if not cluster_ready: @@ -263,7 +296,14 @@ def derive_conditions(self, cluster_ready): else: backend_reason = CONDITION_REASON_INSTALLING - conditions.set_condition(self.rsp, CONDITION_TYPE_BACKEND_READY, backend_ready, backend_reason) + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_BACKEND_READY, + status="True" if backend_ready else "False", + reason=backend_reason, + ), + ) def compose_gke_cluster(self, gke): """Compose a GKECluster XR. @@ -278,12 +318,14 @@ def compose_gke_cluster(self, gke): cls = self.classes.get(pool.className) if not cls or not cls.spec.provisioning or not cls.spec.provisioning.gke: msg = f"InferenceClass {pool.className} has no GKE provisioning block" - conditions.set_condition( + response.set_conditions( self.rsp, - CONDITION_TYPE_CLUSTER_READY, - False, - CONDITION_REASON_INVALID_NODE_POOL, - msg, + resource.Condition( + typ=CONDITION_TYPE_CLUSTER_READY, + status="False", + reason=CONDITION_REASON_INVALID_NODE_POOL, + message=msg, + ), ) response.warning(self.rsp, msg) return @@ -311,7 +353,7 @@ def compose_gke_cluster(self, gke): gkev1alpha1.GKECluster( metadata=metav1.ObjectMeta( name=self.xr.metadata.name, - namespace=metadata.NAMESPACE_SYSTEM, + namespace=_NAMESPACE_SYSTEM, ), spec=gkev1alpha1.Spec( project=gke.project, @@ -327,7 +369,7 @@ def compose_gke_usage(self): resource.update( self.rsp.desired.resources["usage-gke-by-backend"], usagev1beta1.Usage( - metadata=metav1.ObjectMeta(namespace=metadata.NAMESPACE_SYSTEM), + metadata=metav1.ObjectMeta(namespace=_NAMESPACE_SYSTEM), spec=usagev1beta1.Spec( of=usagev1beta1.Of( apiVersion="infrastructure.modelplane.ai/v1alpha1", @@ -416,8 +458,3 @@ def observed_gateway_address(self): return None d = resource.struct_to_dict(observed.resource) return d.get("status", {}).get("gateway", {}).get("address") - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose an InferenceCluster from its cluster source and backend.""" - Composer(req, rsp).compose() diff --git a/functions/compose-inference-cluster/function/main.py b/functions/compose-inference-cluster/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-inference-cluster/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-inference-cluster/lib b/functions/compose-inference-cluster/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-inference-cluster/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-inference-cluster/model b/functions/compose-inference-cluster/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-inference-cluster/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-inference-cluster/pyproject.toml b/functions/compose-inference-cluster/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-inference-cluster/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-inference-cluster/tests/__init__.py b/functions/compose-inference-cluster/tests/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/functions/compose-inference-cluster/tests/__init__.py @@ -0,0 +1 @@ + diff --git a/functions/compose-inference-cluster/tests/test_fn.py b/functions/compose-inference-cluster/tests/test_fn.py new file mode 100644 index 000000000..6c5813b6f --- /dev/null +++ b/functions/compose-inference-cluster/tests/test_fn.py @@ -0,0 +1,452 @@ +"""Tests for the compose-inference-cluster function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.inferencecluster import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-inference-cluster.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function composes an InferenceCluster.""" + # Shared InferenceClass resource for required_resources. + inference_class_l4 = { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "InferenceClass", + "metadata": {"name": "gpu-l4"}, + "spec": { + "resources": { + "gpu": {"count": 1, "memory": "24Gi"}, + }, + "provisioning": { + "provider": "GKE", + "gke": { + "machineType": "g2-standard-48", + "diskSizeGb": 100, + "accelerator": { + "type": "nvidia-l4", + "count": 1, + }, + }, + }, + }, + } + + # Shared resource selector for class requirement. + class_selector = fnv1.ResourceSelector( + api_version="modelplane.ai/v1alpha1", + kind="InferenceClass", + match_name="gpu-l4", + ) + + # --- Case 1: Existing cluster with secrets composes backend and CPC. --- + req1 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.InferenceCluster( + metadata=metav1.ObjectMeta( + name="test-cluster", + namespace="modelplane-system", + ), + spec=v1alpha1.Spec( + cluster=v1alpha1.Cluster( + source="Existing", + existing=v1alpha1.Existing( + secretRef=v1alpha1.SecretRef(name="my-kubeconfig"), + ), + ), + nodePools=[ + v1alpha1.NodePool( + name="l4-pool", + className="gpu-l4", + nodeCount=2, + maxNodeCount=4, + ), + ], + ), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ) + req1.required_resources["class-gpu-l4"].items.append( + fnv1.Resource(resource=resource.dict_to_struct(inference_class_l4)) + ) + + want1 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + { + "status": { + "providerConfigRef": { + "name": "test-cluster-cluster-kubeconfig-d0f89", + }, + "namespace": "modelplane-system", + "capacity": { + "gpuPools": [ + { + "acceleratorType": "nvidia-l4", + "memory": "24Gi", + "countPerNode": 1, + "nodes": 4, + }, + ], + }, + }, + } + ), + ), + resources={ + "cluster-provider-config-kubernetes": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "ClusterProviderConfig", + "metadata": {"name": "test-cluster-cluster-kubeconfig-d0f89"}, + "spec": { + "credentials": { + "source": "Secret", + "secretRef": { + "namespace": "modelplane-system", + "name": "my-kubeconfig", + "key": "kubeconfig", + }, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "kserve-backend": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "infrastructure.modelplane.ai/v1alpha1", + "kind": "KServeBackend", + "metadata": { + "name": "test-cluster-kserve-86cf4", + "namespace": "modelplane-system", + }, + "spec": { + "versions": {}, + "secrets": [ + { + "type": "Kubeconfig", + "name": "my-kubeconfig", + "key": "kubeconfig", + }, + ], + }, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ClusterReady", + status=fnv1.STATUS_CONDITION_TRUE, + reason="ClusterRunning", + ), + fnv1.Condition( + type="BackendReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="Installing", + ), + ], + context=structpb.Struct(), + ) + want1.requirements.resources["class-gpu-l4"].CopyFrom(class_selector) + + # --- Case 2: GKE cluster first pass - no observed GKE, classes resolved. --- + req2 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.InferenceCluster( + metadata=metav1.ObjectMeta( + name="test-cluster", + namespace="modelplane-system", + ), + spec=v1alpha1.Spec( + cluster=v1alpha1.Cluster( + source="GKE", + gke=v1alpha1.Gke( + project="my-gcp-project", + region="us-central1", + ), + ), + nodePools=[ + v1alpha1.NodePool( + name="l4-pool", + className="gpu-l4", + nodeCount=2, + maxNodeCount=4, + zones=["us-central1-a"], + ), + ], + ), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ) + req2.required_resources["class-gpu-l4"].items.append( + fnv1.Resource(resource=resource.dict_to_struct(inference_class_l4)) + ) + + want2 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + { + "status": { + "providerConfigRef": { + "name": "test-cluster-cluster-kubeconfig-d0f89", + }, + "namespace": "modelplane-system", + "capacity": { + "gpuPools": [ + { + "acceleratorType": "nvidia-l4", + "memory": "24Gi", + "countPerNode": 1, + "nodes": 4, + }, + ], + }, + }, + } + ), + ), + resources={ + "gke-cluster": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "infrastructure.modelplane.ai/v1alpha1", + "kind": "GKECluster", + "metadata": { + "name": "test-cluster", + "namespace": "modelplane-system", + }, + "spec": { + "project": "my-gcp-project", + "region": "us-central1", + "nodePools": [ + { + "name": "l4-pool", + "role": "GPU", + "machineType": "g2-standard-48", + "nodeCount": 2, + "minNodeCount": None, + "maxNodeCount": 4, + "gpu": { + "acceleratorType": "nvidia-l4", + "memory": "24Gi", + }, + "zones": ["us-central1-a"], + }, + ], + }, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ClusterReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="Provisioning", + ), + fnv1.Condition( + type="BackendReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="WaitingForCluster", + ), + ], + context=structpb.Struct(), + ) + want2.requirements.resources["class-gpu-l4"].CopyFrom(class_selector) + + # --- Case 3: Existing cluster second pass - backend observed ready. --- + req3 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.InferenceCluster( + metadata=metav1.ObjectMeta( + name="test-cluster", + namespace="modelplane-system", + ), + spec=v1alpha1.Spec( + cluster=v1alpha1.Cluster( + source="Existing", + existing=v1alpha1.Existing( + secretRef=v1alpha1.SecretRef(name="my-kubeconfig"), + ), + ), + nodePools=[ + v1alpha1.NodePool( + name="l4-pool", + className="gpu-l4", + nodeCount=2, + maxNodeCount=4, + ), + ], + ), + ).model_dump(exclude_none=True, mode="json") + ), + ), + resources={ + "kserve-backend": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "infrastructure.modelplane.ai/v1alpha1", + "kind": "KServeBackend", + "metadata": {"name": "test-cluster-kserve-86cf4"}, + "status": { + "conditions": [{"type": "Ready", "status": "True"}], + "gateway": {"address": "34.55.100.10"}, + }, + } + ), + ), + }, + ), + ) + req3.required_resources["class-gpu-l4"].items.append( + fnv1.Resource(resource=resource.dict_to_struct(inference_class_l4)) + ) + + want3 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + { + "status": { + "providerConfigRef": { + "name": "test-cluster-cluster-kubeconfig-d0f89", + }, + "namespace": "modelplane-system", + "capacity": { + "gpuPools": [ + { + "acceleratorType": "nvidia-l4", + "memory": "24Gi", + "countPerNode": 1, + "nodes": 4, + }, + ], + }, + "gateway": {"address": "34.55.100.10"}, + }, + } + ), + ), + resources={ + "cluster-provider-config-kubernetes": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "ClusterProviderConfig", + "metadata": {"name": "test-cluster-cluster-kubeconfig-d0f89"}, + "spec": { + "credentials": { + "source": "Secret", + "secretRef": { + "namespace": "modelplane-system", + "name": "my-kubeconfig", + "key": "kubeconfig", + }, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "kserve-backend": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "infrastructure.modelplane.ai/v1alpha1", + "kind": "KServeBackend", + "metadata": { + "name": "test-cluster-kserve-86cf4", + "namespace": "modelplane-system", + }, + "spec": { + "versions": {}, + "secrets": [ + { + "type": "Kubeconfig", + "name": "my-kubeconfig", + "key": "kubeconfig", + }, + ], + }, + } + ), + ready=fnv1.READY_TRUE, + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ClusterReady", + status=fnv1.STATUS_CONDITION_TRUE, + reason="ClusterRunning", + ), + fnv1.Condition( + type="BackendReady", + status=fnv1.STATUS_CONDITION_TRUE, + reason="BackendHealthy", + ), + ], + context=structpb.Struct(), + ) + want3.requirements.resources["class-gpu-l4"].CopyFrom(class_selector) + + cases = [ + Case(name="existing cluster with secrets composes backend and CPC", req=req1, want=want1), + Case(name="GKE cluster first pass composes GKECluster XR only", req=req2, want=want2), + Case(name="existing cluster second pass with backend ready", req=req3, want=want3), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/functions/compose-inference-gateway/function/__init__.py b/functions/compose-inference-gateway/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-inference-gateway/function/__version__.py b/functions/compose-inference-gateway/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-inference-gateway/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-inference-gateway/main.py b/functions/compose-inference-gateway/function/fn.py similarity index 64% rename from functions/compose-inference-gateway/main.py rename to functions/compose-inference-gateway/function/fn.py index 90dbaf6c6..79799c775 100644 --- a/functions/compose-inference-gateway/main.py +++ b/functions/compose-inference-gateway/function/fn.py @@ -6,14 +6,14 @@ is surfaced in status for compose-model-deployment to use. """ -from crossplane.function import resource, response +import grpc +from crossplane.function import logging, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -from .lib import conditions, helm, metadata -from .lib import resource as libresource -from .model.ai.modelplane.inferencegateway import v1alpha1 -from .model.io.crossplane.protection.usage import v1beta1 as usagev1beta1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.inferencegateway import v1alpha1 +from models.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 +from models.io.crossplane.protection.usage import v1beta1 as usagev1beta1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 # Condition types and reasons for the InferenceGateway XR. CONDITION_TYPE_CONTROLLER_READY = "ControllerReady" @@ -24,6 +24,87 @@ # ProviderConfig name for in-cluster Helm releases on the control plane. _PC_NAME = "modelplane-in-cluster" +# The modelplane-system namespace. Used for Helm release metadata, +# Usage resources, and the Gateway resource. +_NAMESPACE_SYSTEM = "modelplane-system" + +# The control plane gateway name. Used as the Gateway resource name +# and the MetalLB IP pool / L2Advertisement name. +_GATEWAY_NAME = "modelplane" + +# Label key for Helm releases, used in Usage selectors to protect +# ProviderConfigs from premature deletion. +_LABEL_RELEASE = "modelplane.ai/release" + + +def _helm_release( + chart: str, + repo: str, + version: str, + namespace: str, + provider_config: str, + values: dict | None = None, + labels: dict | None = None, + metadata_namespace: str | None = None, +) -> helmv1beta1.Release: + """Build a Helm Release targeting a remote (or local) cluster. + + Args: + chart: The Helm chart name. + repo: The chart repository URL. + version: The chart version. + namespace: The namespace to install the chart into on the target cluster. + provider_config: Name of the ProviderConfig to use. + values: Optional Helm values dict. + labels: Optional labels for the Release metadata. + metadata_namespace: Optional namespace for the Release resource itself. + Set this explicitly when composing from a cluster-scoped XR, since + cluster-scoped XRs don't auto-populate namespace on composed + namespaced resources. + """ + md = None + if labels or metadata_namespace: + md = metav1.ObjectMeta(namespace=metadata_namespace, labels=labels) + + release = helmv1beta1.Release( + metadata=md, + spec=helmv1beta1.Spec( + providerConfigRef=helmv1beta1.ProviderConfigRef( + kind="ProviderConfig", + name=provider_config, + ), + forProvider=helmv1beta1.ForProvider( + chart=helmv1beta1.Chart( + name=chart, + repository=repo, + version=version, + ), + namespace=namespace, + ), + ), + ) + if values: + release.spec.forProvider.values = values + return release + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp + class Composer: def __init__(self, req, rsp): @@ -48,7 +129,7 @@ def compose_provider_config(self): { "apiVersion": "helm.m.crossplane.io/v1beta1", "kind": "ProviderConfig", - "metadata": {"name": _PC_NAME, "namespace": metadata.NAMESPACE_SYSTEM}, + "metadata": {"name": _PC_NAME, "namespace": _NAMESPACE_SYSTEM}, "spec": {"credentials": {"source": "InjectedIdentity"}}, }, ) @@ -77,20 +158,20 @@ def compose_metallb(self): if pc_observed or "metallb" in self.req.observed.resources: resource.update( self.rsp.desired.resources["metallb"], - helm.helm_release( + _helm_release( chart="metallb", repo="https://metallb.github.io/metallb", version="0.14.9", namespace=metallb_ns, provider_config=_PC_NAME, - labels={metadata.LABEL_KEY_RELEASE: "metallb"}, - metadata_namespace=metadata.NAMESPACE_SYSTEM, + labels={_LABEL_RELEASE: "metallb"}, + metadata_namespace=_NAMESPACE_SYSTEM, ), ) self.compose_pc_usage("metallb") # Gate the IPAddressPool and L2Advertisement on MetalLB being ready. - metallb_ready = conditions.has_condition(self.req, "metallb", "Ready") + metallb_ready = resource.get_condition(self.req.observed.resources.get("metallb"), "Ready").status == "True" if not (metallb_ready or "metallb-pool" in self.req.observed.resources): return @@ -99,7 +180,7 @@ def compose_metallb(self): { "apiVersion": "metallb.io/v1beta1", "kind": "IPAddressPool", - "metadata": {"name": "modelplane", "namespace": metallb_ns}, + "metadata": {"name": _GATEWAY_NAME, "namespace": metallb_ns}, "spec": {"addresses": [eg.metallb.addressPool]}, }, ) @@ -110,8 +191,8 @@ def compose_metallb(self): { "apiVersion": "metallb.io/v1beta1", "kind": "L2Advertisement", - "metadata": {"name": "modelplane", "namespace": metallb_ns}, - "spec": {"ipAddressPools": ["modelplane"]}, + "metadata": {"name": _GATEWAY_NAME, "namespace": metallb_ns}, + "spec": {"ipAddressPools": [_GATEWAY_NAME]}, }, ) self.rsp.desired.resources["metallb-l2"].ready = fnv1.READY_TRUE @@ -125,7 +206,7 @@ def compose_envoy_gateway(self): eg = self.xr.spec.envoyGateway resource.update( self.rsp.desired.resources["envoy-gateway"], - helm.helm_release( + _helm_release( chart="gateway-helm", repo="oci://docker.io/envoyproxy", version=eg.version if eg else "v1.3.0", @@ -138,8 +219,8 @@ def compose_envoy_gateway(self): }, }, }, - labels={metadata.LABEL_KEY_RELEASE: "envoy-gateway"}, - metadata_namespace=metadata.NAMESPACE_SYSTEM, + labels={_LABEL_RELEASE: "envoy-gateway"}, + metadata_namespace=_NAMESPACE_SYSTEM, ), ) self.compose_pc_usage("envoy-gateway") @@ -147,7 +228,9 @@ def compose_envoy_gateway(self): def compose_gateway(self): """Compose GatewayClass and Gateway. Gated on Envoy Gateway being ready.""" - envoy_gw_ready = conditions.has_condition(self.req, "envoy-gateway", "Ready") + envoy_gw_ready = ( + resource.get_condition(self.req.observed.resources.get("envoy-gateway"), "Ready").status == "True" + ) if envoy_gw_ready or "gateway-class" in self.req.observed.resources: resource.update( @@ -173,8 +256,8 @@ def compose_gateway(self): "apiVersion": "gateway.networking.k8s.io/v1", "kind": "Gateway", "metadata": { - "name": metadata.GATEWAY_NAME, - "namespace": metadata.NAMESPACE_SYSTEM, + "name": _GATEWAY_NAME, + "namespace": _NAMESPACE_SYSTEM, }, "spec": { "gatewayClassName": "envoy", @@ -202,7 +285,7 @@ def write_status(self): if addresses: status.address = addresses[0].get("value") - libresource.update_status(self.rsp.desired.composite, status) + resource.update_status(self.rsp.desired.composite, status) def derive_conditions(self): """Derive readiness for all composed resources and set custom @@ -214,12 +297,12 @@ def derive_conditions(self): and eg.loadBalancer == "MetalLB" and eg.metallb and eg.metallb.addressPool - and conditions.has_condition(self.req, "metallb", "Ready") + and resource.get_condition(self.req.observed.resources.get("metallb"), "Ready").status == "True" ): self.rsp.desired.resources["metallb"].ready = fnv1.READY_TRUE # Envoy Gateway readiness. - envoy_ready = conditions.has_condition(self.req, "envoy-gateway", "Ready") + envoy_ready = resource.get_condition(self.req.observed.resources.get("envoy-gateway"), "Ready").status == "True" if envoy_ready: self.rsp.desired.resources["envoy-gateway"].ready = fnv1.READY_TRUE # Transition: Envoy Gateway just became ready. @@ -227,20 +310,22 @@ def derive_conditions(self): response.normal(self.rsp, "Envoy Gateway ready, composing Gateway") # ControllerReady condition. - conditions.set_condition( + response.set_conditions( self.rsp, - CONDITION_TYPE_CONTROLLER_READY, - envoy_ready, - CONDITION_REASON_CONTROLLER_HEALTHY if envoy_ready else CONDITION_REASON_INSTALLING, + resource.Condition( + typ=CONDITION_TYPE_CONTROLLER_READY, + status="True" if envoy_ready else "False", + reason=CONDITION_REASON_CONTROLLER_HEALTHY if envoy_ready else CONDITION_REASON_INSTALLING, + ), ) # GatewayClass and Gateway use Accepted (not Ready) — on kind the # Gateway won't be Programmed (no LoadBalancer), but Accepted means # the controller has scheduled it and it's usable. - if conditions.has_condition(self.req, "gateway-class", "Accepted"): + if resource.get_condition(self.req.observed.resources.get("gateway-class"), "Accepted").status == "True": self.rsp.desired.resources["gateway-class"].ready = fnv1.READY_TRUE - if conditions.has_condition(self.req, "gateway", "Accepted"): + if resource.get_condition(self.req.observed.resources.get("gateway"), "Accepted").status == "True": self.rsp.desired.resources["gateway"].ready = fnv1.READY_TRUE def compose_pc_usage(self, release_key): @@ -249,7 +334,7 @@ def compose_pc_usage(self, release_key): resource.update( self.rsp.desired.resources[f"usage-pc-by-{release_key}"], usagev1beta1.Usage( - metadata=metav1.ObjectMeta(namespace=metadata.NAMESPACE_SYSTEM), + metadata=metav1.ObjectMeta(namespace=_NAMESPACE_SYSTEM), spec=usagev1beta1.Spec( of=usagev1beta1.Of( apiVersion="helm.m.crossplane.io/v1beta1", @@ -261,7 +346,7 @@ def compose_pc_usage(self, release_key): kind="Release", resourceSelector=usagev1beta1.ResourceSelector( matchControllerRef=True, - matchLabels={metadata.LABEL_KEY_RELEASE: release_key}, + matchLabels={_LABEL_RELEASE: release_key}, ), ), replayDeletion=True, @@ -269,8 +354,3 @@ def compose_pc_usage(self, release_key): ), ) self.rsp.desired.resources[f"usage-pc-by-{release_key}"].ready = fnv1.READY_TRUE - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose Envoy Gateway, MetalLB, GatewayClass, and Gateway.""" - Composer(req, rsp).compose() diff --git a/functions/compose-inference-gateway/function/main.py b/functions/compose-inference-gateway/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-inference-gateway/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-inference-gateway/lib b/functions/compose-inference-gateway/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-inference-gateway/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-inference-gateway/model b/functions/compose-inference-gateway/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-inference-gateway/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-inference-gateway/pyproject.toml b/functions/compose-inference-gateway/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-inference-gateway/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-inference-gateway/tests/__init__.py b/functions/compose-inference-gateway/tests/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/functions/compose-inference-gateway/tests/__init__.py @@ -0,0 +1 @@ + diff --git a/functions/compose-inference-gateway/tests/test_fn.py b/functions/compose-inference-gateway/tests/test_fn.py new file mode 100644 index 000000000..a68312771 --- /dev/null +++ b/functions/compose-inference-gateway/tests/test_fn.py @@ -0,0 +1,294 @@ +"""Tests for the compose-inference-gateway function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.inferencegateway import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-inference-gateway.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function composes an InferenceGateway.""" + cases = [ + Case( + name="first pass composes provider config only; envoy gateway and gateway are gated", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.InferenceGateway( + metadata=metav1.ObjectMeta( + name="test-gateway", + namespace="modelplane-system", + ), + spec=v1alpha1.Spec(), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {}}), + ), + resources={ + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "metadata": { + "name": "modelplane-in-cluster", + "namespace": "modelplane-system", + }, + "spec": {"credentials": {"source": "InjectedIdentity"}}, + } + ), + ready=fnv1.READY_TRUE, + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ControllerReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="Installing", + ), + ], + context=structpb.Struct(), + ), + ), + Case( + name="second pass with observed provider config and envoy gateway ready composes gateway resources", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.InferenceGateway( + metadata=metav1.ObjectMeta( + name="test-gateway", + namespace="modelplane-system", + ), + spec=v1alpha1.Spec(), + ).model_dump(exclude_none=True, mode="json") + ), + ), + resources={ + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "metadata": {"name": "modelplane-in-cluster"}, + } + ), + ), + "envoy-gateway": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "status": { + "conditions": [{"type": "Ready", "status": "True"}], + }, + } + ), + ), + "gateway": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": {"name": "modelplane"}, + "status": { + "addresses": [{"value": "10.0.0.42"}], + "conditions": [{"type": "Accepted", "status": "True"}], + }, + } + ), + ), + "gateway-class": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "GatewayClass", + "metadata": {"name": "envoy"}, + "status": { + "conditions": [{"type": "Accepted", "status": "True"}], + }, + } + ), + ), + }, + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + {"status": {"address": "10.0.0.42"}}, + ), + ), + resources={ + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "metadata": { + "name": "modelplane-in-cluster", + "namespace": "modelplane-system", + }, + "spec": {"credentials": {"source": "InjectedIdentity"}}, + } + ), + ready=fnv1.READY_TRUE, + ), + "envoy-gateway": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "metadata": { + "namespace": "modelplane-system", + "labels": {"modelplane.ai/release": "envoy-gateway"}, + }, + "spec": { + "providerConfigRef": { + "kind": "ProviderConfig", + "name": "modelplane-in-cluster", + }, + "forProvider": { + "chart": { + "name": "gateway-helm", + "repository": "oci://docker.io/envoyproxy", + "version": "v1.3.0", + }, + "namespace": "envoy-gateway-system", + "values": { + "config": { + "envoyGateway": { + "extensionApis": {"enableBackend": True}, + }, + }, + }, + }, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "usage-pc-by-envoy-gateway": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "protection.crossplane.io/v1beta1", + "kind": "Usage", + "metadata": {"namespace": "modelplane-system"}, + "spec": { + "of": { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "resourceRef": {"name": "modelplane-in-cluster"}, + }, + "by": { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "resourceSelector": { + "matchControllerRef": True, + "matchLabels": {"modelplane.ai/release": "envoy-gateway"}, + }, + }, + "replayDeletion": True, + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "gateway-class": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "GatewayClass", + "metadata": {"name": "envoy"}, + "spec": { + "controllerName": "gateway.envoyproxy.io/gatewayclass-controller", + }, + } + ), + ready=fnv1.READY_TRUE, + ), + "gateway": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "name": "modelplane", + "namespace": "modelplane-system", + }, + "spec": { + "gatewayClassName": "envoy", + "listeners": [ + { + "name": "http", + "protocol": "HTTP", + "port": 80, + "allowedRoutes": {"namespaces": {"from": "All"}}, + }, + ], + }, + } + ), + ready=fnv1.READY_TRUE, + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ControllerReady", + status=fnv1.STATUS_CONDITION_TRUE, + reason="ControllerHealthy", + ), + ], + context=structpb.Struct(), + ), + ), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/functions/compose-kserve-backend/function/__init__.py b/functions/compose-kserve-backend/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-kserve-backend/function/__version__.py b/functions/compose-kserve-backend/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-kserve-backend/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-kserve-backend/main.py b/functions/compose-kserve-backend/function/fn.py similarity index 71% rename from functions/compose-kserve-backend/main.py rename to functions/compose-kserve-backend/function/fn.py index 07540892f..c20ab7a6e 100644 --- a/functions/compose-kserve-backend/main.py +++ b/functions/compose-kserve-backend/function/fn.py @@ -13,22 +13,45 @@ import json from pathlib import Path -from crossplane.function import resource, response +import grpc +from crossplane.function import logging, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -from .lib import conditions, helm, k8s, keda, metadata, naming, prometheus, secrets -from .lib import resource as libresource -from .model.ai.modelplane.infrastructure.kservebackend import v1alpha1 -from .model.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 -from .model.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 -from .model.io.crossplane.m.kubernetes.providerconfig import ( +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.infrastructure.kservebackend import v1alpha1 +from models.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 +from models.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 +from models.io.crossplane.m.kubernetes.object import v1alpha1 as k8sobjv1alpha1 +from models.io.crossplane.m.kubernetes.providerconfig import ( v1alpha1 as k8spcv1alpha1, ) -from .model.io.crossplane.protection.usage import v1beta1 as usagev1beta1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 +from models.io.crossplane.protection.usage import v1beta1 as usagev1beta1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 _HERE = Path(__file__).parent +# Label key for composed resources that need deletion ordering via Usages. +_LABEL_RESOURCE = "modelplane.ai/resource" + +# Secret types that couple compose-gke-cluster (writer) to this function +# (reader) via the InferenceCluster status. +_SECRET_TYPE_KUBECONFIG = "Kubeconfig" +_SECRET_TYPE_GCP_SA_KEY = "GCPServiceAccountKey" + +# Identity type for GCP service account credentials. +_IDENTITY_TYPE_GCP = "GoogleApplicationCredentials" + +# Prometheus constants. +_PROMETHEUS_NAMESPACE = "monitoring" +_PROMETHEUS_FULLNAME_OVERRIDE = "prometheus" +_PROMETHEUS_URL = f"http://{_PROMETHEUS_FULLNAME_OVERRIDE}-prometheus.{_PROMETHEUS_NAMESPACE}.svc.cluster.local:9090" +_PROMETHEUS_CHART = "kube-prometheus-stack" +_PROMETHEUS_REPO = "https://prometheus-community.github.io/helm-charts" + +# KEDA constants. +_KEDA_NAMESPACE = "keda" +_KEDA_CHART = "keda" +_KEDA_REPO = "https://kedacore.github.io/charts" + # Gateway API Inference Extension CRDs (InferenceModel, InferencePool). # Not part of any Helm chart — applied as raw provider-kubernetes Objects. _INFERENCE_EXTENSION_CRDS = json.loads((_HERE / "inference_extension_crds.json").read_text()) @@ -75,9 +98,157 @@ ) +def _helm_release( + chart: str, + repo: str, + version: str, + namespace: str, + provider_config: str, + values: dict | None = None, + labels: dict | None = None, + metadata_namespace: str | None = None, +) -> helmv1beta1.Release: + """Build a Helm Release targeting a remote (or local) cluster.""" + md = None + if labels or metadata_namespace: + md = metav1.ObjectMeta(namespace=metadata_namespace, labels=labels) + + release = helmv1beta1.Release( + metadata=md, + spec=helmv1beta1.Spec( + providerConfigRef=helmv1beta1.ProviderConfigRef( + kind="ProviderConfig", + name=provider_config, + ), + forProvider=helmv1beta1.ForProvider( + chart=helmv1beta1.Chart( + name=chart, + repository=repo, + version=version, + ), + namespace=namespace, + ), + ), + ) + if values: + release.spec.forProvider.values = values + return release + + +def _k8s_object( + provider_config: str, + manifest: dict, + metadata: metav1.ObjectMeta | None = None, + management_policies: list | None = None, +) -> k8sobjv1alpha1.Object: + """Build a provider-kubernetes Object wrapping an arbitrary manifest.""" + obj = k8sobjv1alpha1.Object( + metadata=metadata, + spec=k8sobjv1alpha1.Spec( + providerConfigRef=k8sobjv1alpha1.ProviderConfigRef( + kind="ProviderConfig", + name=provider_config, + ), + forProvider=k8sobjv1alpha1.ForProvider( + manifest=manifest, + ), + ), + ) + if management_policies: + obj.spec.managementPolicies = management_policies + return obj + + +def _prometheus_release(version: str, provider_config: str) -> helmv1beta1.Release: + """Build a kube-prometheus-stack Helm release for a backend cluster.""" + return _helm_release( + chart=_PROMETHEUS_CHART, + repo=_PROMETHEUS_REPO, + version=version, + namespace=_PROMETHEUS_NAMESPACE, + provider_config=provider_config, + values={ + "fullnameOverride": _PROMETHEUS_FULLNAME_OVERRIDE, + "prometheus": { + "prometheusSpec": { + # Discover PodMonitors across all namespaces. + "podMonitorSelectorNilUsesHelmValues": False, + "podMonitorNamespaceSelector": {}, + # Scrape Envoy Gateway proxy pods for upstream request + # metrics (envoy_cluster_upstream_rq_active). Envoy + # Gateway is used for ingress, and this metric measures + # in-flight requests at the proxy level. + "additionalScrapeConfigs": [ + { + "job_name": "envoy-gateway-proxy", + "kubernetes_sd_configs": [ + { + "role": "pod", + "namespaces": { + "names": ["envoy-gateway-system"], + }, + }, + ], + "relabel_configs": [ + { + "source_labels": [ + "__meta_kubernetes_pod_label_app_kubernetes_io_component", + ], + "action": "keep", + "regex": "proxy", + }, + { + "source_labels": ["__address__"], + "action": "replace", + "regex": "([^:]+)(?::\\d+)?", + "replacement": "$1:19001", + "target_label": "__address__", + }, + ], + "metrics_path": "/stats/prometheus", + }, + ], + }, + }, + # Disable components we don't need for autoscaling. + "grafana": {"enabled": False}, + "alertmanager": {"enabled": False}, + }, + ) + + +def _keda_release(version: str, provider_config: str) -> helmv1beta1.Release: + """Build a KEDA Helm release for a backend cluster.""" + return _helm_release( + chart=_KEDA_CHART, + repo=_KEDA_REPO, + version=version, + namespace=_KEDA_NAMESPACE, + provider_config=provider_config, + ) + + def _pc_name(xr): """Derive the ProviderConfig name from the XR.""" - return naming.dns_name(xr.metadata.name, "cluster") + return resource.child_name(xr.metadata.name, "cluster") + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp class Composer: @@ -107,7 +278,7 @@ def compose_provider_configs(self): kubeconfig secret is missing.""" xr_secrets = self.xr.spec.secrets or [] - kubeconfig_secret = next((s for s in xr_secrets if s.type == secrets.SECRET_TYPE_KUBECONFIG), None) + kubeconfig_secret = next((s for s in xr_secrets if s.type == _SECRET_TYPE_KUBECONFIG), None) if not kubeconfig_secret: response.warning(self.rsp, "spec.secrets must include a Kubeconfig entry") return False @@ -138,12 +309,12 @@ def compose_provider_configs(self): ) gcp_secret = next( - (s for s in xr_secrets if s.type == secrets.SECRET_TYPE_GCP_SA_KEY), + (s for s in xr_secrets if s.type == _SECRET_TYPE_GCP_SA_KEY), None, ) if gcp_secret: k8s_pc_spec.identity = k8spcv1alpha1.Identity( - type="GoogleApplicationCredentials", + type=_IDENTITY_TYPE_GCP, source="Secret", secretRef=k8spcv1alpha1.SecretRef( name=gcp_secret.name, @@ -152,7 +323,7 @@ def compose_provider_configs(self): ), ) helm_pc_spec.identity = helmpcv1beta1.Identity( - type="GoogleApplicationCredentials", + type=_IDENTITY_TYPE_GCP, source="Secret", secretRef=helmpcv1beta1.SecretRef( name=gcp_secret.name, @@ -248,7 +419,7 @@ def compose_usages(self): kind="Object", resourceSelector=usagev1beta1.ResourceSelectorModel( matchControllerRef=True, - matchLabels={metadata.LABEL_KEY_RESOURCE: "gateway-class"}, + matchLabels={_LABEL_RESOURCE: "gateway-class"}, ), ), by=usagev1beta1.By( @@ -256,7 +427,7 @@ def compose_usages(self): kind="Object", resourceSelector=usagev1beta1.ResourceSelector( matchControllerRef=True, - matchLabels={metadata.LABEL_KEY_RESOURCE: "gateway"}, + matchLabels={_LABEL_RESOURCE: "gateway"}, ), ), replayDeletion=True, @@ -277,7 +448,7 @@ def compose_usages(self): kind="Release", resourceSelector=usagev1beta1.ResourceSelectorModel( matchControllerRef=True, - matchLabels={metadata.LABEL_KEY_RESOURCE: "envoy-gateway"}, + matchLabels={_LABEL_RESOURCE: "envoy-gateway"}, ), ), by=usagev1beta1.By( @@ -285,7 +456,7 @@ def compose_usages(self): kind="Object", resourceSelector=usagev1beta1.ResourceSelector( matchControllerRef=True, - matchLabels={metadata.LABEL_KEY_RESOURCE: "gateway-class"}, + matchLabels={_LABEL_RESOURCE: "gateway-class"}, ), ), replayDeletion=True, @@ -303,7 +474,7 @@ def compose_cert_manager(self): v = self.xr.spec.versions or v1alpha1.Versions() resource.update( self.rsp.desired.resources["cert-manager"], - helm.helm_release( + _helm_release( chart="cert-manager", repo="https://charts.jetstack.io", version=v.certManager, @@ -322,13 +493,13 @@ def compose_envoy_gateway(self): v = self.xr.spec.versions or v1alpha1.Versions() resource.update( self.rsp.desired.resources["envoy-gateway"], - helm.helm_release( + _helm_release( chart="gateway-helm", repo="oci://docker.io/envoyproxy", version=v.envoyGateway, namespace="envoy-gateway-system", provider_config=_pc_name(self.xr), - labels={metadata.LABEL_KEY_RESOURCE: "envoy-gateway"}, + labels={_LABEL_RESOURCE: "envoy-gateway"}, values={ "config": { "envoyGateway": { @@ -349,7 +520,7 @@ def compose_prometheus(self): v = self.xr.spec.versions or v1alpha1.Versions() resource.update( self.rsp.desired.resources["prometheus"], - prometheus.helm_release(v.prometheus, _pc_name(self.xr)), + _prometheus_release(v.prometheus, _pc_name(self.xr)), ) def compose_keda(self): @@ -357,7 +528,9 @@ def compose_keda(self): cert-manager being ready. KEDA uses admission webhooks that require cert-manager for TLS.""" pc_observed = self.provider_configs_observed() - cert_manager_ready = conditions.has_condition(self.req, "cert-manager", "Ready") + cert_manager_ready = ( + resource.get_condition(self.req.observed.resources.get("cert-manager"), "Ready").status == "True" + ) gate = pc_observed and cert_manager_ready if not (gate or "keda" in self.req.observed.resources): @@ -366,7 +539,7 @@ def compose_keda(self): v = self.xr.spec.versions or v1alpha1.Versions() resource.update( self.rsp.desired.resources["keda"], - keda.helm_release(v.keda, _pc_name(self.xr)), + _keda_release(v.keda, _pc_name(self.xr)), ) def compose_leader_worker_set(self): @@ -378,7 +551,7 @@ def compose_leader_worker_set(self): v = self.xr.spec.versions or v1alpha1.Versions() resource.update( self.rsp.desired.resources["leader-worker-set"], - helm.helm_release( + _helm_release( chart="lws", repo="oci://registry.k8s.io/lws/charts", version=v.leaderWorkerSet, @@ -402,7 +575,7 @@ def compose_inference_ext_crds(self): resource.update( self.rsp.desired.resources[key], - k8s.k8s_object(_pc_name(self.xr), crd), + _k8s_object(_pc_name(self.xr), crd), ) def compose_gateway(self): @@ -421,7 +594,7 @@ def compose_gateway(self): if pc_observed or "gateway-class" in self.req.observed.resources: resource.update( self.rsp.desired.resources["gateway-class"], - k8s.k8s_object( + _k8s_object( pc, { "apiVersion": "gateway.networking.k8s.io/v1", @@ -431,14 +604,14 @@ def compose_gateway(self): "controllerName": "gateway.envoyproxy.io/gatewayclass-controller", }, }, - metadata=metav1.ObjectMeta(labels={metadata.LABEL_KEY_RESOURCE: "gateway-class"}), + metadata=metav1.ObjectMeta(labels={_LABEL_RESOURCE: "gateway-class"}), ), ) if pc_observed or "gateway" in self.req.observed.resources: resource.update( self.rsp.desired.resources["gateway"], - k8s.k8s_object( + _k8s_object( pc, { "apiVersion": "gateway.networking.k8s.io/v1", @@ -458,7 +631,7 @@ def compose_gateway(self): ], }, }, - metadata=metav1.ObjectMeta(labels={metadata.LABEL_KEY_RESOURCE: "gateway"}), + metadata=metav1.ObjectMeta(labels={_LABEL_RESOURCE: "gateway"}), ), ) @@ -469,7 +642,9 @@ def compose_kserve(self): validating webhook that Helm calls during install. Both fail if cert-manager isn't fully up.""" pc_observed = self.provider_configs_observed() - cert_manager_ready = conditions.has_condition(self.req, "cert-manager", "Ready") + cert_manager_ready = ( + resource.get_condition(self.req.observed.resources.get("cert-manager"), "Ready").status == "True" + ) gate = pc_observed and cert_manager_ready v = self.xr.spec.versions or v1alpha1.Versions() @@ -478,7 +653,7 @@ def compose_kserve(self): if gate or "kserve-crds" in self.req.observed.resources: resource.update( self.rsp.desired.resources["kserve-crds"], - helm.helm_release( + _helm_release( chart="kserve-llmisvc-crd", repo="oci://ghcr.io/kserve/charts", version=v.kserve, @@ -488,8 +663,8 @@ def compose_kserve(self): ) if gate or "kserve-controller" in self.req.observed.resources: - patch_cm_name = naming.dns_name(self.xr.metadata.name, "storage-patch") - kserve_release = helm.helm_release( + patch_cm_name = resource.child_name(self.xr.metadata.name, "storage-patch") + kserve_release = _helm_release( chart="kserve-llmisvc-resources", repo="oci://ghcr.io/kserve/charts", version=v.kserve, @@ -510,7 +685,7 @@ def compose_kserve(self): # Transition: cert-manager is ready, KServe not yet composed. if not cert_manager_ready: return - if conditions.has_condition(self.req, "kserve-controller", "Ready"): + if resource.get_condition(self.req.observed.resources.get("kserve-controller"), "Ready").status == "True": return if "kserve-controller" in self.req.observed.resources: return @@ -525,7 +700,7 @@ def compose_storage_patch(self): "apiVersion": "v1", "kind": "ConfigMap", "metadata": { - "name": naming.dns_name(self.xr.metadata.name, "storage-patch"), + "name": resource.child_name(self.xr.metadata.name, "storage-patch"), "namespace": self.xr.metadata.namespace, }, "data": { @@ -554,7 +729,7 @@ def write_status(self): status = v1alpha1.Status() if gateway_address: status.gateway = v1alpha1.GatewayModel(address=gateway_address) - libresource.update_status(self.rsp.desired.composite, status) + resource.update_status(self.rsp.desired.composite, status) def mark_readiness(self): """Mark composed resources as ready. Resources that don't need external @@ -585,7 +760,10 @@ def mark_readiness(self): "gateway", ] for r in condition_ready: - if r in self.rsp.desired.resources and conditions.has_condition(self.req, r, "Ready"): + if ( + r in self.rsp.desired.resources + and resource.get_condition(self.req.observed.resources.get(r), "Ready").status == "True" + ): self.rsp.desired.resources[r].ready = fnv1.READY_TRUE def provider_configs_observed(self): @@ -597,8 +775,3 @@ def provider_configs_observed(self): "provider-config-helm" in self.req.observed.resources and "provider-config-kubernetes" in self.req.observed.resources ) - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose the KServe inference backend on a remote cluster.""" - Composer(req, rsp).compose() diff --git a/functions/compose-kserve-backend/inference_extension_crds.json b/functions/compose-kserve-backend/function/inference_extension_crds.json similarity index 100% rename from functions/compose-kserve-backend/inference_extension_crds.json rename to functions/compose-kserve-backend/function/inference_extension_crds.json diff --git a/functions/compose-kserve-backend/inference_extension_crds.yaml b/functions/compose-kserve-backend/function/inference_extension_crds.yaml similarity index 100% rename from functions/compose-kserve-backend/inference_extension_crds.yaml rename to functions/compose-kserve-backend/function/inference_extension_crds.yaml diff --git a/functions/compose-kserve-backend/function/main.py b/functions/compose-kserve-backend/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-kserve-backend/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-kserve-backend/lib b/functions/compose-kserve-backend/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-kserve-backend/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-kserve-backend/model b/functions/compose-kserve-backend/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-kserve-backend/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-kserve-backend/pyproject.toml b/functions/compose-kserve-backend/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-kserve-backend/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-kserve-backend/tests/__init__.py b/functions/compose-kserve-backend/tests/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/functions/compose-kserve-backend/tests/__init__.py @@ -0,0 +1 @@ + diff --git a/functions/compose-kserve-backend/tests/test_fn.py b/functions/compose-kserve-backend/tests/test_fn.py new file mode 100644 index 000000000..5db1e1c9b --- /dev/null +++ b/functions/compose-kserve-backend/tests/test_fn.py @@ -0,0 +1,1251 @@ +"""Tests for the compose-kserve-backend function.""" + +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.infrastructure.kservebackend import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +# The kustomize storage patch value, as it appears in function output. +_KUSTOMIZE_STORAGE_PATCH = '{"patches": [{"patch": "{\\"apiVersion\\": \\"v1\\", \\"kind\\": \\"ConfigMap\\", \\"metadata\\": {\\"name\\": \\"inferenceservice-config\\"}, \\"data\\": {\\"storageInitializer\\": \\"{\\\\\\"image\\\\\\": \\\\\\"kserve/storage-initializer:latest\\\\\\", \\\\\\"memoryRequest\\\\\\": \\\\\\"100Mi\\\\\\", \\\\\\"memoryLimit\\\\\\": \\\\\\"4Gi\\\\\\", \\\\\\"cpuRequest\\\\\\": \\\\\\"100m\\\\\\", \\\\\\"cpuLimit\\\\\\": \\\\\\"1\\\\\\", \\\\\\"caBundleConfigMapName\\\\\\": \\\\\\"\\\\\\", \\\\\\"caBundleVolumeMountPath\\\\\\": \\\\\\"/etc/ssl/custom-certs\\\\\\", \\\\\\"enableModelcar\\\\\\": true, \\\\\\"cpuModelcar\\\\\\": \\\\\\"10m\\\\\\", \\\\\\"memoryModelcar\\\\\\": \\\\\\"15Mi\\\\\\", \\\\\\"uidModelcar\\\\\\": 1010}\\"}}", "target": {"kind": "ConfigMap", "name": "inferenceservice-config"}}]}' + +# Precomputed child_name values for test-backend. +_PC_NAME = "test-backend-cluster-63fde" +_STORAGE_PATCH_NAME = "test-backend-storage-patch-bc0a3" + +# The InferenceModel CRD manifest, used in cases 2 and 3. +_INFERENCE_MODEL_CRD = { + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "annotations": { + "controller-gen.kubebuilder.io/version": "v0.16.1", + }, + "name": "inferencemodels.inference.networking.x-k8s.io", + }, + "spec": { + "group": "inference.networking.x-k8s.io", + "names": { + "kind": "InferenceModel", + "listKind": "InferenceModelList", + "plural": "inferencemodels", + "singular": "inferencemodel", + }, + "scope": "Namespaced", + "versions": [ + { + "additionalPrinterColumns": [ + { + "jsonPath": ".spec.modelName", + "name": "Model Name", + "type": "string", + }, + { + "jsonPath": ".spec.poolRef.name", + "name": "Inference Pool", + "type": "string", + }, + { + "jsonPath": ".spec.criticality", + "name": "Criticality", + "type": "string", + }, + { + "jsonPath": ".metadata.creationTimestamp", + "name": "Age", + "type": "date", + }, + ], + "name": "v1alpha2", + "schema": { + "openAPIV3Schema": { + "description": "InferenceModel is the Schema for the InferenceModels API.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string", + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string", + }, + "metadata": { + "type": "object", + }, + "spec": { + "description": 'InferenceModelSpec represents the desired state of a specific model use case. This resource is\nmanaged by the "Inference Workload Owner" persona.\n\nThe Inference Workload Owner persona is someone that trains, verifies, and\nleverages a large language model from a model frontend, drives the lifecycle\nand rollout of new versions of those models, and defines the specific\nperformance and latency goals for the model. These workloads are\nexpected to operate within an InferencePool sharing compute capacity with other\nInferenceModels, defined by the Inference Platform Admin.\n\nInferenceModel\'s modelName (not the ObjectMeta name) is unique for a given InferencePool,\nif the name is reused, an error will be shown on the status of a\nInferenceModel that attempted to reuse. The oldest InferenceModel, based on\ncreation timestamp, will be selected to remain valid. In the event of a race\ncondition, one will be selected at random.', + "properties": { + "criticality": { + "description": "Criticality defines how important it is to serve the model compared to other models referencing the same pool.\nCriticality impacts how traffic is handled in resource constrained situations. It handles this by\nqueuing or rejecting requests of lower criticality. InferenceModels of an equivalent Criticality will\nfairly share resources over throughput of tokens. In the future, the metric used to calculate fairness,\nand the proportionality of fairness will be configurable.\n\nDefault values for this field will not be set, to allow for future additions of new field that may 'one of' with this field.\nAny implementations that may consume this field may treat an unset value as the 'Standard' range.", + "enum": [ + "Critical", + "Standard", + "Sheddable", + ], + "type": "string", + }, + "modelName": { + "description": 'ModelName is the name of the model as it will be set in the "model" parameter for an incoming request.\nModelNames must be unique for a referencing InferencePool\n(names can be reused for a different pool in the same cluster).\nThe modelName with the oldest creation timestamp is retained, and the incoming\nInferenceModel is sets the Ready status to false with a corresponding reason.\nIn the rare case of a race condition, one Model will be selected randomly to be considered valid, and the other rejected.\nNames can be reserved without an underlying model configured in the pool.\nThis can be done by specifying a target model and setting the weight to zero,\nan error will be returned specifying that no valid target model is found.', + "maxLength": 256.0, + "type": "string", + "x-kubernetes-validations": [ + { + "message": "modelName is immutable", + "rule": "self == oldSelf", + }, + ], + }, + "poolRef": { + "description": "PoolRef is a reference to the inference pool, the pool must exist in the same namespace.", + "properties": { + "group": { + "default": "inference.networking.x-k8s.io", + "description": "Group is the group of the referent.", + "maxLength": 253.0, + "pattern": "^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + "type": "string", + }, + "kind": { + "default": "InferencePool", + "description": 'Kind is kind of the referent. For example "InferencePool".', + "maxLength": 63.0, + "minLength": 1.0, + "pattern": "^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$", + "type": "string", + }, + "name": { + "description": "Name is the name of the referent.", + "maxLength": 253.0, + "minLength": 1.0, + "type": "string", + }, + }, + "required": [ + "name", + ], + "type": "object", + }, + "targetModels": { + "description": "TargetModels allow multiple versions of a model for traffic splitting.\nIf not specified, the target model name is defaulted to the modelName parameter.\nmodelName is often in reference to a LoRA adapter.", + "items": { + "description": "TargetModel represents a deployed model or a LoRA adapter. The\nName field is expected to match the name of the LoRA adapter\n(or base model) as it is registered within the model server. Inference\nGateway assumes that the model exists on the model server and it's the\nresponsibility of the user to validate a correct match. Should a model fail\nto exist at request time, the error is processed by the Inference Gateway\nand emitted on the appropriate InferenceModel object.", + "properties": { + "name": { + "description": "Name is the name of the adapter or base model, as expected by the ModelServer.", + "maxLength": 253.0, + "type": "string", + }, + "weight": { + "description": "Weight is used to determine the proportion of traffic that should be\nsent to this model when multiple target models are specified.\n\nWeight defines the proportion of requests forwarded to the specified\nmodel. This is computed as weight/(sum of all weights in this\nTargetModels list). For non-zero values, there may be some epsilon from\nthe exact proportion defined here depending on the precision an\nimplementation supports. Weight is not a percentage and the sum of\nweights does not need to equal 100.\n\nIf a weight is set for any targetModel, it must be set for all targetModels.\nConversely weights are optional, so long as ALL targetModels do not specify a weight.", + "format": "int32", + "maximum": 1000000.0, + "minimum": 1.0, + "type": "integer", + }, + }, + "required": [ + "name", + ], + "type": "object", + }, + "maxItems": 10.0, + "type": "array", + "x-kubernetes-validations": [ + { + "message": "Weights should be set for all models, or none of the models.", + "rule": "self.all(model, has(model.weight)) || self.all(model, !has(model.weight))", + }, + ], + }, + }, + "required": [ + "modelName", + "poolRef", + ], + "type": "object", + }, + "status": { + "description": "InferenceModelStatus defines the observed state of InferenceModel", + "properties": { + "conditions": { + "default": [ + { + "lastTransitionTime": "1970-01-01T00:00:00Z", + "message": "Waiting for controller", + "reason": "Pending", + "status": "Unknown", + "type": "Ready", + }, + ], + "description": 'Conditions track the state of the InferenceModel.\n\nKnown condition types are:\n\n* "Accepted"', + "items": { + "description": "Condition contains details for one aspect of the current state of this API Resource.", + "properties": { + "lastTransitionTime": { + "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", + "format": "date-time", + "type": "string", + }, + "message": { + "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.", + "maxLength": 32768.0, + "type": "string", + }, + "observedGeneration": { + "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.", + "format": "int64", + "minimum": 0.0, + "type": "integer", + }, + "reason": { + "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.", + "maxLength": 1024.0, + "minLength": 1.0, + "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$", + "type": "string", + }, + "status": { + "description": "status of the condition, one of True, False, Unknown.", + "enum": [ + "True", + "False", + "Unknown", + ], + "type": "string", + }, + "type": { + "description": "type of condition in CamelCase or in foo.example.com/CamelCase.", + "maxLength": 316.0, + "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$", + "type": "string", + }, + }, + "required": [ + "lastTransitionTime", + "message", + "reason", + "status", + "type", + ], + "type": "object", + }, + "maxItems": 8.0, + "type": "array", + "x-kubernetes-list-map-keys": [ + "type", + ], + "x-kubernetes-list-type": "map", + }, + }, + "type": "object", + }, + }, + "type": "object", + }, + }, + "served": True, + "storage": True, + "subresources": { + "status": {}, + }, + }, + ], + }, +} + +# The InferencePool CRD manifest, used in cases 2 and 3. +_INFERENCE_POOL_CRD = { + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "annotations": { + "controller-gen.kubebuilder.io/version": "v0.16.1", + }, + "name": "inferencepools.inference.networking.x-k8s.io", + }, + "spec": { + "group": "inference.networking.x-k8s.io", + "names": { + "kind": "InferencePool", + "listKind": "InferencePoolList", + "plural": "inferencepools", + "singular": "inferencepool", + }, + "scope": "Namespaced", + "versions": [ + { + "name": "v1alpha2", + "schema": { + "openAPIV3Schema": { + "description": "InferencePool is the Schema for the InferencePools API.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string", + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string", + }, + "metadata": { + "type": "object", + }, + "spec": { + "description": "InferencePoolSpec defines the desired state of InferencePool", + "properties": { + "extensionRef": { + "description": "Extension configures an endpoint picker as an extension service.", + "properties": { + "failureMode": { + "default": "FailClose", + "description": "Configures how the gateway handles the case when the extension is not responsive.\nDefaults to failClose.", + "enum": [ + "FailOpen", + "FailClose", + ], + "type": "string", + }, + "group": { + "default": "", + "description": 'Group is the group of the referent.\nThe default value is "", representing the Core API group.', + "maxLength": 253.0, + "pattern": "^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + "type": "string", + }, + "kind": { + "default": "Service", + "description": 'Kind is the Kubernetes resource kind of the referent. For example\n"Service".\n\nDefaults to "Service" when not specified.\n\nExternalName services can refer to CNAME DNS records that may live\noutside of the cluster and as such are difficult to reason about in\nterms of conformance. They also may not be safe to forward to (see\nCVE-2021-25740 for more information). Implementations MUST NOT\nsupport ExternalName Services.', + "maxLength": 63.0, + "minLength": 1.0, + "pattern": "^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$", + "type": "string", + }, + "name": { + "description": "Name is the name of the referent.", + "maxLength": 253.0, + "minLength": 1.0, + "type": "string", + }, + "portNumber": { + "description": "The port number on the service running the extension. When unspecified,\nimplementations SHOULD infer a default value of 9002 when the Kind is\nService.", + "format": "int32", + "maximum": 65535.0, + "minimum": 1.0, + "type": "integer", + }, + }, + "required": [ + "name", + ], + "type": "object", + }, + "selector": { + "additionalProperties": { + "description": "LabelValue is the value of a label. This is used for validation\nof maps. This matches the Kubernetes label validation rules:\n* must be 63 characters or less (can be empty),\n* unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]),\n* could contain dashes (-), underscores (_), dots (.), and alphanumerics between.\n\nValid values include:\n\n* MyValue\n* my.name\n* 123-my-value", + "maxLength": 63.0, + "minLength": 0.0, + "pattern": "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$", + "type": "string", + }, + "description": "Selector defines a map of labels to watch model server pods\nthat should be included in the InferencePool.\nIn some cases, implementations may translate this field to a Service selector, so this matches the simple\nmap used for Service selectors instead of the full Kubernetes LabelSelector type.\nIf sepecified, it will be applied to match the model server pods in the same namespace as the InferencePool.\nCross namesoace selector is not supported.", + "type": "object", + }, + "targetPortNumber": { + "description": "TargetPortNumber defines the port number to access the selected model servers.\nThe number must be in the range 1 to 65535.", + "format": "int32", + "maximum": 65535.0, + "minimum": 1.0, + "type": "integer", + }, + }, + "required": [ + "extensionRef", + "selector", + "targetPortNumber", + ], + "type": "object", + }, + "status": { + "description": "InferencePoolStatus defines the observed state of InferencePool", + "properties": { + "parent": { + "description": "Parents is a list of parent resources (usually Gateways) that are\nassociated with the route, and the status of the InferencePool with respect to\neach parent.\n\nA maximum of 32 Gateways will be represented in this list. An empty list\nmeans the route has not been attached to any Gateway.", + "items": { + "description": "PoolStatus defines the observed state of InferencePool from a Gateway.", + "properties": { + "conditions": { + "default": [ + { + "lastTransitionTime": "1970-01-01T00:00:00Z", + "message": "Waiting for controller", + "reason": "Pending", + "status": "Unknown", + "type": "Accepted", + }, + ], + "description": 'Conditions track the state of the InferencePool.\n\nKnown condition types are:\n\n* "Accepted"\n* "ResolvedRefs"', + "items": { + "description": "Condition contains details for one aspect of the current state of this API Resource.", + "properties": { + "lastTransitionTime": { + "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", + "format": "date-time", + "type": "string", + }, + "message": { + "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.", + "maxLength": 32768.0, + "type": "string", + }, + "observedGeneration": { + "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.", + "format": "int64", + "minimum": 0.0, + "type": "integer", + }, + "reason": { + "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.", + "maxLength": 1024.0, + "minLength": 1.0, + "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$", + "type": "string", + }, + "status": { + "description": "status of the condition, one of True, False, Unknown.", + "enum": [ + "True", + "False", + "Unknown", + ], + "type": "string", + }, + "type": { + "description": "type of condition in CamelCase or in foo.example.com/CamelCase.", + "maxLength": 316.0, + "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$", + "type": "string", + }, + }, + "required": [ + "lastTransitionTime", + "message", + "reason", + "status", + "type", + ], + "type": "object", + }, + "maxItems": 8.0, + "type": "array", + "x-kubernetes-list-map-keys": [ + "type", + ], + "x-kubernetes-list-type": "map", + }, + "parentRef": { + "description": "GatewayRef indicates the gateway that observed state of InferencePool.", + "properties": { + "apiVersion": { + "description": "API version of the referent.", + "type": "string", + }, + "fieldPath": { + "description": 'If referring to a piece of an object instead of an entire object, this string\nshould contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].\nFor example, if the object reference is to a container within a pod, this would take on a value like:\n"spec.containers{name}" (where "name" refers to the name of the container that triggered\nthe event) or if no container name is specified "spec.containers[2]" (container with\nindex 2 in this pod). This syntax is chosen only to have some well-defined way of\nreferencing a part of an object.', + "type": "string", + }, + "kind": { + "description": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string", + }, + "name": { + "description": "Name of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + "type": "string", + }, + "namespace": { + "description": "Namespace of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", + "type": "string", + }, + "resourceVersion": { + "description": "Specific resourceVersion to which this reference is made, if any.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", + "type": "string", + }, + "uid": { + "description": "UID of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids", + "type": "string", + }, + }, + "type": "object", + "x-kubernetes-map-type": "atomic", + }, + }, + "required": [ + "parentRef", + ], + "type": "object", + }, + "maxItems": 32.0, + "type": "array", + }, + }, + "type": "object", + }, + }, + "type": "object", + }, + }, + "served": True, + "storage": True, + "subresources": { + "status": {}, + }, + }, + ], + }, +} + +# Shared resource dicts used across test cases. +_PROVIDER_CONFIG_KUBERNETES = { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "ProviderConfig", + "metadata": {"name": _PC_NAME}, + "spec": { + "credentials": { + "secretRef": { + "key": "kubeconfig", + "name": "kube-secret", + "namespace": "test-ns", + }, + "source": "Secret", + }, + "identity": { + "secretRef": { + "key": "private_key", + "name": "sa-secret", + "namespace": "test-ns", + }, + "source": "Secret", + "type": "GoogleApplicationCredentials", + }, + }, +} + +_PROVIDER_CONFIG_HELM = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "metadata": {"name": _PC_NAME}, + "spec": { + "credentials": { + "secretRef": { + "key": "kubeconfig", + "name": "kube-secret", + "namespace": "test-ns", + }, + "source": "Secret", + }, + "identity": { + "secretRef": { + "key": "private_key", + "name": "sa-secret", + "namespace": "test-ns", + }, + "source": "Secret", + "type": "GoogleApplicationCredentials", + }, + }, +} + +_USAGE_HELM_PC = { + "apiVersion": "protection.crossplane.io/v1beta1", + "kind": "Usage", + "spec": { + "by": { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "resourceSelector": {"matchControllerRef": True}, + }, + "of": { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "ProviderConfig", + "resourceRef": {"name": _PC_NAME}, + }, + "replayDeletion": True, + }, +} + +_USAGE_K8S_PC = { + "apiVersion": "protection.crossplane.io/v1beta1", + "kind": "Usage", + "spec": { + "by": { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "resourceSelector": {"matchControllerRef": True}, + }, + "of": { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "ProviderConfig", + "resourceRef": {"name": _PC_NAME}, + }, + "replayDeletion": True, + }, +} + +_USAGE_ENVOY_GW_BY_GATEWAY_CLASS = { + "apiVersion": "protection.crossplane.io/v1beta1", + "kind": "Usage", + "spec": { + "by": { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "resourceSelector": { + "matchControllerRef": True, + "matchLabels": {"modelplane.ai/resource": "gateway-class"}, + }, + }, + "of": { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "resourceSelector": { + "matchControllerRef": True, + "matchLabels": {"modelplane.ai/resource": "envoy-gateway"}, + }, + }, + "replayDeletion": True, + }, +} + +_USAGE_GATEWAY_CLASS_BY_GATEWAY = { + "apiVersion": "protection.crossplane.io/v1beta1", + "kind": "Usage", + "spec": { + "by": { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "resourceSelector": { + "matchControllerRef": True, + "matchLabels": {"modelplane.ai/resource": "gateway"}, + }, + }, + "of": { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "resourceSelector": { + "matchControllerRef": True, + "matchLabels": {"modelplane.ai/resource": "gateway-class"}, + }, + }, + "replayDeletion": True, + }, +} + +_KSERVE_STORAGE_PATCH = { + "apiVersion": "v1", + "kind": "ConfigMap", + "metadata": { + "name": _STORAGE_PATCH_NAME, + "namespace": "test-ns", + }, + "data": {"patches": _KUSTOMIZE_STORAGE_PATCH}, +} + +_CERT_MANAGER = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "spec": { + "forProvider": { + "chart": { + "name": "cert-manager", + "repository": "https://charts.jetstack.io", + "version": "v1.17.1", + }, + "namespace": "cert-manager", + "values": { + "crds": { + "enabled": True, + "keep": False, + }, + }, + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_ENVOY_GATEWAY = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "metadata": { + "labels": {"modelplane.ai/resource": "envoy-gateway"}, + }, + "spec": { + "forProvider": { + "chart": { + "name": "gateway-helm", + "repository": "oci://docker.io/envoyproxy", + "version": "v1.3.0", + }, + "namespace": "envoy-gateway-system", + "values": { + "config": { + "envoyGateway": { + "extensionApis": {"enableBackend": True}, + }, + }, + }, + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_GATEWAY = { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "metadata": { + "labels": {"modelplane.ai/resource": "gateway"}, + }, + "spec": { + "forProvider": { + "manifest": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "name": "kserve-ingress-gateway", + "namespace": "kserve", + }, + "spec": { + "gatewayClassName": "envoy", + "listeners": [ + { + "allowedRoutes": { + "namespaces": {"from": "All"}, + }, + "name": "http", + "port": 80.0, + "protocol": "HTTP", + }, + ], + }, + }, + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_GATEWAY_CLASS = { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "metadata": { + "labels": {"modelplane.ai/resource": "gateway-class"}, + }, + "spec": { + "forProvider": { + "manifest": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "GatewayClass", + "metadata": {"name": "envoy"}, + "spec": { + "controllerName": "gateway.envoyproxy.io/gatewayclass-controller", + }, + }, + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_INFERENCE_EXT_CRD_INFERENCEMODELS = { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "spec": { + "forProvider": { + "manifest": _INFERENCE_MODEL_CRD, + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_INFERENCE_EXT_CRD_INFERENCEPOOLS = { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "spec": { + "forProvider": { + "manifest": _INFERENCE_POOL_CRD, + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_LEADER_WORKER_SET = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "spec": { + "forProvider": { + "chart": { + "name": "lws", + "repository": "oci://registry.k8s.io/lws/charts", + "version": "v0.7.0", + }, + "namespace": "lws-system", + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_PROMETHEUS = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "spec": { + "forProvider": { + "chart": { + "name": "kube-prometheus-stack", + "repository": "https://prometheus-community.github.io/helm-charts", + "version": "72.6.2", + }, + "namespace": "monitoring", + "values": { + "alertmanager": {"enabled": False}, + "fullnameOverride": "prometheus", + "grafana": {"enabled": False}, + "prometheus": { + "prometheusSpec": { + "additionalScrapeConfigs": [ + { + "job_name": "envoy-gateway-proxy", + "kubernetes_sd_configs": [ + { + "namespaces": { + "names": ["envoy-gateway-system"], + }, + "role": "pod", + }, + ], + "metrics_path": "/stats/prometheus", + "relabel_configs": [ + { + "action": "keep", + "regex": "proxy", + "source_labels": [ + "__meta_kubernetes_pod_label_app_kubernetes_io_component", + ], + }, + { + "action": "replace", + "regex": "([^:]+)(?::\\d+)?", + "replacement": "$1:19001", + "source_labels": ["__address__"], + "target_label": "__address__", + }, + ], + }, + ], + "podMonitorNamespaceSelector": {}, + "podMonitorSelectorNilUsesHelmValues": False, + }, + }, + }, + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_KSERVE_CRDS = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "spec": { + "forProvider": { + "chart": { + "name": "kserve-llmisvc-crd", + "repository": "oci://ghcr.io/kserve/charts", + "version": "v0.16.0", + }, + "namespace": "kserve", + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_KSERVE_CONTROLLER = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "spec": { + "forProvider": { + "chart": { + "name": "kserve-llmisvc-resources", + "repository": "oci://ghcr.io/kserve/charts", + "version": "v0.16.0", + }, + "namespace": "kserve", + "patchesFrom": [ + { + "configMapKeyRef": { + "key": "patches", + "name": _STORAGE_PATCH_NAME, + }, + }, + ], + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + +_KEDA = { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "spec": { + "forProvider": { + "chart": { + "name": "keda", + "repository": "https://kedacore.github.io/charts", + "version": "2.17.1", + }, + "namespace": "keda", + }, + "providerConfigRef": { + "kind": "ProviderConfig", + "name": _PC_NAME, + }, + }, +} + + +def _base_request() -> fnv1.RunFunctionRequest: + """Build the base RunFunctionRequest used by all test cases.""" + return fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.KServeBackend( + metadata=metav1.ObjectMeta( + name="test-backend", + namespace="test-ns", + ), + spec=v1alpha1.Spec( + secrets=[ + v1alpha1.Secret(type="Kubeconfig", name="kube-secret", key="kubeconfig"), + v1alpha1.Secret(type="GCPServiceAccountKey", name="sa-secret", key="private_key"), + ], + ), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_first_pass(self) -> None: + """First pass composes provider configs, usages, and storage patch; releases gated.""" + req = _base_request() + + want = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {}}), + ), + resources={ + "kserve-storage-patch": fnv1.Resource( + resource=resource.dict_to_struct(_KSERVE_STORAGE_PATCH), + ready=fnv1.READY_TRUE, + ), + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct(_PROVIDER_CONFIG_HELM), + ready=fnv1.READY_TRUE, + ), + "provider-config-kubernetes": fnv1.Resource( + resource=resource.dict_to_struct(_PROVIDER_CONFIG_KUBERNETES), + ready=fnv1.READY_TRUE, + ), + "usage-envoy-gw-by-gateway-class": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_ENVOY_GW_BY_GATEWAY_CLASS), + ready=fnv1.READY_TRUE, + ), + "usage-gateway-class-by-gateway": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_GATEWAY_CLASS_BY_GATEWAY), + ready=fnv1.READY_TRUE, + ), + "usage-helm-pc": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_HELM_PC), + ready=fnv1.READY_TRUE, + ), + "usage-k8s-pc": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_K8S_PC), + ready=fnv1.READY_TRUE, + ), + }, + ), + context=structpb.Struct(), + ) + + got = await self.runner.RunFunction(req, None) + self.assertEqual( + json_format.MessageToDict(want), + json_format.MessageToDict(got), + "-want, +got", + ) + + async def test_second_pass(self) -> None: + """Observed PCs ungate Helm releases, CRD objects, and gateway objects.""" + req = _base_request() + req.observed.resources["provider-config-helm"].CopyFrom( + fnv1.Resource( + resource=resource.dict_to_struct( + {"apiVersion": "helm.m.crossplane.io/v1beta1", "kind": "ProviderConfig"} + ), + ), + ) + req.observed.resources["provider-config-kubernetes"].CopyFrom( + fnv1.Resource( + resource=resource.dict_to_struct( + {"apiVersion": "kubernetes.m.crossplane.io/v1alpha1", "kind": "ProviderConfig"} + ), + ), + ) + + want = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {}}), + ), + resources={ + "cert-manager": fnv1.Resource( + resource=resource.dict_to_struct(_CERT_MANAGER), + ), + "envoy-gateway": fnv1.Resource( + resource=resource.dict_to_struct(_ENVOY_GATEWAY), + ), + "gateway": fnv1.Resource( + resource=resource.dict_to_struct(_GATEWAY), + ), + "gateway-class": fnv1.Resource( + resource=resource.dict_to_struct(_GATEWAY_CLASS), + ), + "inference-ext-crd-inferencemodels": fnv1.Resource( + resource=resource.dict_to_struct(_INFERENCE_EXT_CRD_INFERENCEMODELS), + ), + "inference-ext-crd-inferencepools": fnv1.Resource( + resource=resource.dict_to_struct(_INFERENCE_EXT_CRD_INFERENCEPOOLS), + ), + "kserve-storage-patch": fnv1.Resource( + resource=resource.dict_to_struct(_KSERVE_STORAGE_PATCH), + ready=fnv1.READY_TRUE, + ), + "leader-worker-set": fnv1.Resource( + resource=resource.dict_to_struct(_LEADER_WORKER_SET), + ), + "prometheus": fnv1.Resource( + resource=resource.dict_to_struct(_PROMETHEUS), + ), + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct(_PROVIDER_CONFIG_HELM), + ready=fnv1.READY_TRUE, + ), + "provider-config-kubernetes": fnv1.Resource( + resource=resource.dict_to_struct(_PROVIDER_CONFIG_KUBERNETES), + ready=fnv1.READY_TRUE, + ), + "usage-envoy-gw-by-gateway-class": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_ENVOY_GW_BY_GATEWAY_CLASS), + ready=fnv1.READY_TRUE, + ), + "usage-gateway-class-by-gateway": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_GATEWAY_CLASS_BY_GATEWAY), + ready=fnv1.READY_TRUE, + ), + "usage-helm-pc": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_HELM_PC), + ready=fnv1.READY_TRUE, + ), + "usage-k8s-pc": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_K8S_PC), + ready=fnv1.READY_TRUE, + ), + }, + ), + context=structpb.Struct(), + ) + + got = await self.runner.RunFunction(req, None) + self.assertEqual( + json_format.MessageToDict(want), + json_format.MessageToDict(got), + "-want, +got", + ) + + async def test_third_pass(self) -> None: + """cert-manager ready ungates KServe CRDs, controller, and KEDA; gateway address surfaced.""" + req = _base_request() + req.observed.resources["provider-config-helm"].CopyFrom( + fnv1.Resource( + resource=resource.dict_to_struct( + {"apiVersion": "helm.m.crossplane.io/v1beta1", "kind": "ProviderConfig"} + ), + ), + ) + req.observed.resources["provider-config-kubernetes"].CopyFrom( + fnv1.Resource( + resource=resource.dict_to_struct( + {"apiVersion": "kubernetes.m.crossplane.io/v1alpha1", "kind": "ProviderConfig"} + ), + ), + ) + req.observed.resources["cert-manager"].CopyFrom( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "helm.m.crossplane.io/v1beta1", + "kind": "Release", + "status": {"conditions": [{"type": "Ready", "status": "True"}]}, + } + ), + ), + ) + req.observed.resources["gateway"].CopyFrom( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "status": { + "atProvider": { + "manifest": {"status": {"addresses": [{"value": "172.18.255.200"}]}}, + }, + }, + } + ), + ), + ) + + want = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + {"status": {"gateway": {"address": "172.18.255.200"}}}, + ), + ), + resources={ + "cert-manager": fnv1.Resource( + resource=resource.dict_to_struct(_CERT_MANAGER), + ready=fnv1.READY_TRUE, + ), + "envoy-gateway": fnv1.Resource( + resource=resource.dict_to_struct(_ENVOY_GATEWAY), + ), + "gateway": fnv1.Resource( + resource=resource.dict_to_struct(_GATEWAY), + ), + "gateway-class": fnv1.Resource( + resource=resource.dict_to_struct(_GATEWAY_CLASS), + ), + "inference-ext-crd-inferencemodels": fnv1.Resource( + resource=resource.dict_to_struct(_INFERENCE_EXT_CRD_INFERENCEMODELS), + ), + "inference-ext-crd-inferencepools": fnv1.Resource( + resource=resource.dict_to_struct(_INFERENCE_EXT_CRD_INFERENCEPOOLS), + ), + "keda": fnv1.Resource( + resource=resource.dict_to_struct(_KEDA), + ), + "kserve-controller": fnv1.Resource( + resource=resource.dict_to_struct(_KSERVE_CONTROLLER), + ), + "kserve-crds": fnv1.Resource( + resource=resource.dict_to_struct(_KSERVE_CRDS), + ), + "kserve-storage-patch": fnv1.Resource( + resource=resource.dict_to_struct(_KSERVE_STORAGE_PATCH), + ready=fnv1.READY_TRUE, + ), + "leader-worker-set": fnv1.Resource( + resource=resource.dict_to_struct(_LEADER_WORKER_SET), + ), + "prometheus": fnv1.Resource( + resource=resource.dict_to_struct(_PROMETHEUS), + ), + "provider-config-helm": fnv1.Resource( + resource=resource.dict_to_struct(_PROVIDER_CONFIG_HELM), + ready=fnv1.READY_TRUE, + ), + "provider-config-kubernetes": fnv1.Resource( + resource=resource.dict_to_struct(_PROVIDER_CONFIG_KUBERNETES), + ready=fnv1.READY_TRUE, + ), + "usage-envoy-gw-by-gateway-class": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_ENVOY_GW_BY_GATEWAY_CLASS), + ready=fnv1.READY_TRUE, + ), + "usage-gateway-class-by-gateway": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_GATEWAY_CLASS_BY_GATEWAY), + ready=fnv1.READY_TRUE, + ), + "usage-helm-pc": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_HELM_PC), + ready=fnv1.READY_TRUE, + ), + "usage-k8s-pc": fnv1.Resource( + resource=resource.dict_to_struct(_USAGE_K8S_PC), + ready=fnv1.READY_TRUE, + ), + }, + ), + results=[ + fnv1.Result( + severity=fnv1.SEVERITY_NORMAL, + message="cert-manager ready, composing KServe", + ), + ], + context=structpb.Struct(), + ) + + got = await self.runner.RunFunction(req, None) + self.assertEqual( + json_format.MessageToDict(want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/functions/compose-model-deployment/function/__init__.py b/functions/compose-model-deployment/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-deployment/function/__version__.py b/functions/compose-model-deployment/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-model-deployment/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-deployment/main.py b/functions/compose-model-deployment/function/fn.py similarity index 63% rename from functions/compose-model-deployment/main.py rename to functions/compose-model-deployment/function/fn.py index 963a36a46..8be3a7a3a 100644 --- a/functions/compose-model-deployment/main.py +++ b/functions/compose-model-deployment/function/fn.py @@ -6,17 +6,17 @@ ModelService to route to. """ -from crossplane.function import request, resource, response +import grpc +from crossplane.function import logging, request, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 +from models.ai.modelplane.modeldeployment import v1alpha1 +from models.ai.modelplane.modelendpoint import v1alpha1 as mev1alpha1 +from models.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from . import scheduling -from .lib import conditions, defaults, metadata, naming -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modeldeployment import v1alpha1 -from .model.ai.modelplane.modelendpoint import v1alpha1 as mev1alpha1 -from .model.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 +from function import scheduling # Condition types and reasons for the ModelDeployment XR. CONDITION_TYPE_REPLICAS_SCHEDULED = "ReplicasScheduled" @@ -28,6 +28,52 @@ CONDITION_REASON_SCHEDULING = "Scheduling" CONDITION_REASON_NO_REPLICAS_SCHEDULED = "NoReplicasScheduled" CONDITION_REASON_ALL_REPLICAS_READY = "AllReplicasReady" +CONDITION_REASON_MODEL_STARTING = "ModelStarting" + +# Label keys and values. These are coordination contracts: compose-model-replica +# and compose-model-service read labels that this function writes. +_LABEL_CLUSTER = "modelplane.ai/cluster" +_LABEL_REPLICA = "modelplane.ai/replica" +_LABEL_DEPLOYMENT = "modelplane.ai/deployment" +_LABEL_VALUE_TRUE = "true" + +# Namespace for LLMInferenceService on remote clusters. +_NAMESPACE_REMOTE = "default" + +# Scheme for gateway-facing URLs. Traffic between the control plane gateway +# and remote cluster gateways uses plain HTTP; TLS terminates at the edge. +_GATEWAY_SCHEME = "http" + + +def _inference_cluster( + ic: icv1alpha1.InferenceCluster, +) -> icv1alpha1.InferenceCluster: + """Return a copy with status fields defaulted.""" + ic = ic.model_copy(deep=True) + ic.status = ic.status or icv1alpha1.Status() + ic.status.providerConfigRef = ic.status.providerConfigRef or icv1alpha1.ProviderConfigRef() + ic.status.gateway = ic.status.gateway or icv1alpha1.Gateway() + ic.status.capacity = ic.status.capacity or icv1alpha1.Capacity() + ic.status.capacity.gpuPools = ic.status.capacity.gpuPools or [] + return ic + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp class Composer: @@ -55,7 +101,7 @@ def resolve_inputs(self): # InferenceClusters are matched by the modelplane.ai/cluster=true # label — a workaround for the empty match_labels protobuf bug. cluster_match_labels: dict[str, str] = { - metadata.LABEL_KEY_CLUSTER: metadata.LABEL_VALUE_CLUSTER, + _LABEL_CLUSTER: _LABEL_VALUE_TRUE, } if self.xr.spec.clusterSelector and self.xr.spec.clusterSelector.matchLabels: cluster_match_labels.update(self.xr.spec.clusterSelector.matchLabels) @@ -72,26 +118,26 @@ def resolve_inputs(self): name="all-replicas", api_version="modelplane.ai/v1alpha1", kind="ModelReplica", - match_labels={metadata.LABEL_KEY_REPLICA: metadata.LABEL_VALUE_REPLICA}, + match_labels={_LABEL_REPLICA: _LABEL_VALUE_TRUE}, ) cluster_dicts = request.get_required_resources(self.req, "clusters") replica_dicts = request.get_required_resources(self.req, "all-replicas") if not cluster_dicts: - conditions.set_condition( + response.set_conditions( self.rsp, - CONDITION_TYPE_REPLICAS_SCHEDULED, - False, - CONDITION_REASON_NO_CLUSTERS, + resource.Condition( + typ=CONDITION_TYPE_REPLICAS_SCHEDULED, + status="False", + reason=CONDITION_REASON_NO_CLUSTERS, + ), ) response.warning(self.rsp, "No InferenceClusters found") return False - self.clusters = [ - defaults.inference_cluster(icv1alpha1.InferenceCluster.model_validate(c)) for c in cluster_dicts - ] - self.all_replicas = [defaults.model_replica(mrv1alpha1.ModelReplica.model_validate(r)) for r in replica_dicts] + self.clusters = [_inference_cluster(icv1alpha1.InferenceCluster.model_validate(c)) for c in cluster_dicts] + self.all_replicas = [mrv1alpha1.ModelReplica.model_validate(r) for r in replica_dicts] return True @@ -127,12 +173,12 @@ def compose_replicas(self, matched): self.rsp.desired.resources[replica_key], mrv1alpha1.ModelReplica( metadata=metav1.ObjectMeta( - name=naming.replica_name(self.xr.metadata.name, cluster_info.name), + name=resource.child_name(self.xr.metadata.name, cluster_info.name), namespace=self.xr.metadata.namespace, labels={ - metadata.LABEL_KEY_REPLICA: metadata.LABEL_VALUE_REPLICA, - metadata.LABEL_KEY_DEPLOYMENT: self.xr.metadata.name, - metadata.LABEL_KEY_CLUSTER: cluster_info.name, + _LABEL_REPLICA: _LABEL_VALUE_TRUE, + _LABEL_DEPLOYMENT: self.xr.metadata.name, + _LABEL_CLUSTER: cluster_info.name, }, ), spec=mrv1alpha1.SpecModel( @@ -152,22 +198,22 @@ def compose_endpoints(self, matched): remote cluster's gateway. The rewritePath tells ModelService what URL prefix to rewrite to on the remote cluster. """ - llmis = naming.llmis_name(self.xr.metadata.name) - rewrite_path = f"/{metadata.NAMESPACE_REMOTE}/{llmis}/" + llmis = resource.child_name(self.xr.metadata.name) + rewrite_path = f"/{_NAMESPACE_REMOTE}/{llmis}/" for cluster_info in matched: endpoint_key = f"endpoint-{cluster_info.name}" - url = f"{metadata.GATEWAY_SCHEME}://{cluster_info.gateway_address}{rewrite_path}v1" + url = f"{_GATEWAY_SCHEME}://{cluster_info.gateway_address}{rewrite_path}v1" resource.update( self.rsp.desired.resources[endpoint_key], mev1alpha1.ModelEndpoint( metadata=metav1.ObjectMeta( - name=naming.endpoint_name(self.xr.metadata.name, cluster_info.name), + name=resource.child_name(self.xr.metadata.name, cluster_info.name), namespace=self.xr.metadata.namespace, labels={ - metadata.LABEL_KEY_DEPLOYMENT: self.xr.metadata.name, - metadata.LABEL_KEY_CLUSTER: cluster_info.name, + _LABEL_DEPLOYMENT: self.xr.metadata.name, + _LABEL_CLUSTER: cluster_info.name, }, ), spec=mev1alpha1.Spec( @@ -179,12 +225,16 @@ def compose_endpoints(self, matched): def write_status(self, matched): """Write deployment status: replica counts.""" - replicas_ready = sum(1 for c in matched if conditions.has_condition(self.req, f"replica-{c.name}", "Ready")) + replicas_ready = sum( + 1 + for c in matched + if resource.get_condition(self.req.observed.resources.get(f"replica-{c.name}"), "Ready").status == "True" + ) status = v1alpha1.Status( replicas=v1alpha1.Replicas(total=len(matched), ready=replicas_ready), ) - libresource.update_status(self.rsp.desired.composite, status) + resource.update_status(self.rsp.desired.composite, status) def derive_conditions(self, matched): """Derive ReplicasScheduled and ReplicasReady. Per-resource @@ -213,14 +263,22 @@ def derive_replicas_scheduled(self, matched): reason = CONDITION_REASON_SCHEDULING msg = "" - conditions.set_condition(self.rsp, CONDITION_TYPE_REPLICAS_SCHEDULED, scheduled, reason, msg) + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_REPLICAS_SCHEDULED, + status="True" if scheduled else "False", + reason=reason, + message=msg, + ), + ) def derive_replicas_ready(self, matched): """ReplicasReady: all replicas are serving traffic.""" replicas_ready = 0 for c in matched: replica_key = f"replica-{c.name}" - if conditions.has_condition(self.req, replica_key, "Ready"): + if resource.get_condition(self.req.observed.resources.get(replica_key), "Ready").status == "True": self.rsp.desired.resources[replica_key].ready = fnv1.READY_TRUE replicas_ready += 1 @@ -233,10 +291,18 @@ def derive_replicas_ready(self, matched): reason = CONDITION_REASON_ALL_REPLICAS_READY msg = f"{replicas_ready} of {len(matched)} ready" else: - reason = conditions.CONDITION_REASON_MODEL_STARTING + reason = CONDITION_REASON_MODEL_STARTING msg = f"{replicas_ready} of {len(matched)} ready" - conditions.set_condition(self.rsp, CONDITION_TYPE_REPLICAS_READY, all_ready, reason, msg) + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_REPLICAS_READY, + status="True" if all_ready else "False", + reason=reason, + message=msg, + ), + ) def mark_endpoint_readiness(self, matched): """Mark each composed ModelEndpoint Ready when observed Ready.""" @@ -244,10 +310,5 @@ def mark_endpoint_readiness(self, matched): endpoint_key = f"endpoint-{c.name}" if endpoint_key not in self.rsp.desired.resources: continue - if conditions.has_condition(self.req, endpoint_key, "Ready"): + if resource.get_condition(self.req.observed.resources.get(endpoint_key), "Ready").status == "True": self.rsp.desired.resources[endpoint_key].ready = fnv1.READY_TRUE - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose ModelReplicas and ModelEndpoints.""" - Composer(req, rsp).compose() diff --git a/functions/compose-model-deployment/function/main.py b/functions/compose-model-deployment/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-model-deployment/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-model-deployment/scheduling.py b/functions/compose-model-deployment/function/scheduling.py similarity index 89% rename from functions/compose-model-deployment/scheduling.py rename to functions/compose-model-deployment/function/scheduling.py index 31be5fedf..8fd4017a0 100644 --- a/functions/compose-model-deployment/scheduling.py +++ b/functions/compose-model-deployment/function/scheduling.py @@ -9,10 +9,13 @@ from dataclasses import dataclass -from .lib import metadata -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modeldeployment import v1alpha1 as mdv1alpha1 -from .model.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 +from models.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 +from models.ai.modelplane.modeldeployment import v1alpha1 as mdv1alpha1 +from models.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 + +# Label key written by compose-model-deployment, read here for stable +# scheduling (prefer clusters that already have a replica for this deployment). +_LABEL_DEPLOYMENT = "modelplane.ai/deployment" @dataclass @@ -90,7 +93,7 @@ def schedule( existing_clusters = { r.spec.inferenceClusterRef.name for r in all_replicas - if (r.metadata.labels or {}).get(metadata.LABEL_KEY_DEPLOYMENT) == deployment.metadata.name + if (r.metadata.labels or {}).get(_LABEL_DEPLOYMENT) == deployment.metadata.name } candidates = [] @@ -145,7 +148,7 @@ def _used_gpus(deployment, cluster, all_replicas) -> int: """ used = 0 for r in all_replicas: - if (r.metadata.labels or {}).get(metadata.LABEL_KEY_DEPLOYMENT) == deployment.metadata.name: + if (r.metadata.labels or {}).get(_LABEL_DEPLOYMENT) == deployment.metadata.name: continue if r.spec.inferenceClusterRef.name != cluster.metadata.name: continue diff --git a/functions/compose-model-deployment/lib b/functions/compose-model-deployment/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-model-deployment/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-model-deployment/model b/functions/compose-model-deployment/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-model-deployment/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-model-deployment/pyproject.toml b/functions/compose-model-deployment/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-model-deployment/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-model-deployment/tests/__init__.py b/functions/compose-model-deployment/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-deployment/tests/test_fn.py b/functions/compose-model-deployment/tests/test_fn.py new file mode 100644 index 000000000..e3badb4f9 --- /dev/null +++ b/functions/compose-model-deployment/tests/test_fn.py @@ -0,0 +1,434 @@ +"""Tests for the compose-model-deployment function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.modeldeployment import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-model-deployment.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function fans out ModelReplicas and ModelEndpoints.""" + + xr = v1alpha1.ModelDeployment( + metadata=metav1.ObjectMeta(name="my-model", namespace="ml-team"), + spec=v1alpha1.SpecModel( + replicas=1, + workers=v1alpha1.Workers( + topology=v1alpha1.Topology(tensor=1), + template=v1alpha1.Template( + spec=v1alpha1.Spec( + containers=[ + v1alpha1.Container( + name="engine", + image="vllm/vllm-openai:latest", + args=["--model=Qwen/Qwen3-0.6B"], + ), + ], + ), + ), + ), + ), + ).model_dump(exclude_none=True, mode="json") + + cluster_a = { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "InferenceCluster", + "metadata": {"name": "cluster-a"}, + "spec": { + "cluster": {"source": "Existing", "existing": {"secretRef": {"name": "k"}}}, + }, + "status": { + "conditions": [ + { + "type": "Ready", + "status": "True", + "reason": "Available", + "lastTransitionTime": "2025-01-01T00:00:00Z", + } + ], + "gateway": {"address": "10.0.0.1"}, + "providerConfigRef": {"name": "cluster-a"}, + "capacity": {"gpuPools": [{"countPerNode": 1, "nodes": 2}]}, + }, + } + + # Requirements are the same for all cases that reach resolve_inputs. + cluster_sel = fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="InferenceCluster") + cluster_sel.match_labels.labels.update({"modelplane.ai/cluster": "true"}) + replica_sel = fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="ModelReplica") + replica_sel.match_labels.labels.update({"modelplane.ai/replica": "true"}) + + # Case 1: one ready cluster matches — composes replica and endpoint. + req1 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req1.required_resources["clusters"].items.append(fnv1.Resource(resource=resource.dict_to_struct(cluster_a))) + req1.required_resources["all-replicas"].SetInParent() + + want1 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {"replicas": {"total": 1, "ready": 0}}}), + ), + resources={ + "replica-cluster-a": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelReplica", + "metadata": { + "name": "my-model-cluster-a-bc3c4", + "namespace": "ml-team", + "labels": { + "modelplane.ai/replica": "true", + "modelplane.ai/deployment": "my-model", + "modelplane.ai/cluster": "cluster-a", + }, + }, + "spec": { + "inferenceClusterRef": {"name": "cluster-a"}, + "workers": { + "topology": {"tensor": 1}, + "template": { + "spec": { + "containers": [ + { + "name": "engine", + "image": "vllm/vllm-openai:latest", + "args": ["--model=Qwen/Qwen3-0.6B"], + } + ], + }, + }, + }, + }, + } + ), + ), + "endpoint-cluster-a": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelEndpoint", + "metadata": { + "name": "my-model-cluster-a-bc3c4", + "namespace": "ml-team", + "labels": { + "modelplane.ai/deployment": "my-model", + "modelplane.ai/cluster": "cluster-a", + }, + }, + "spec": { + "url": "http://10.0.0.1/default/my-model-98ad2/v1", + "rewritePath": "/default/my-model-98ad2/", + }, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ReplicasScheduled", + status=fnv1.STATUS_CONDITION_FALSE, + reason="Scheduling", + ), + fnv1.Condition( + type="ReplicasReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="ModelStarting", + message="0 of 1 ready", + ), + ], + results=[ + fnv1.Result(severity=fnv1.SEVERITY_NORMAL, message="Matched 1 clusters: cluster-a"), + ], + context=structpb.Struct(), + ) + want1.requirements.resources["clusters"].CopyFrom(cluster_sel) + want1.requirements.resources["all-replicas"].CopyFrom(replica_sel) + + # Case 2: no clusters — warning. + req2 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req2.required_resources["clusters"].SetInParent() + req2.required_resources["all-replicas"].SetInParent() + + want2 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State(), + conditions=[ + fnv1.Condition( + type="ReplicasScheduled", + status=fnv1.STATUS_CONDITION_FALSE, + reason="NoClusters", + ), + ], + results=[ + fnv1.Result(severity=fnv1.SEVERITY_WARNING, message="No InferenceClusters found"), + ], + context=structpb.Struct(), + ) + want2.requirements.resources["clusters"].CopyFrom(cluster_sel) + want2.requirements.resources["all-replicas"].CopyFrom(replica_sel) + + # Case 3: cluster has insufficient capacity. + req3 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req3.required_resources["clusters"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "InferenceCluster", + "metadata": {"name": "cluster-a"}, + "spec": { + "cluster": {"source": "Existing", "existing": {"secretRef": {"name": "k"}}}, + }, + "status": { + "conditions": [ + { + "type": "Ready", + "status": "True", + "reason": "Available", + "lastTransitionTime": "2025-01-01T00:00:00Z", + } + ], + "gateway": {"address": "10.0.0.1"}, + "providerConfigRef": {"name": "cluster-a"}, + "capacity": {"gpuPools": [{"countPerNode": 0, "nodes": 0}]}, + }, + } + ) + ) + ) + req3.required_resources["all-replicas"].SetInParent() + + want3 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {"replicas": {"total": 0, "ready": 0}}}), + ready=fnv1.READY_FALSE, + ), + ), + conditions=[ + fnv1.Condition( + type="ReplicasScheduled", + status=fnv1.STATUS_CONDITION_FALSE, + reason="InsufficientCapacity", + message="0 of 1 clusters matched (checked 1)", + ), + fnv1.Condition( + type="ReplicasReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="NoReplicasScheduled", + ), + ], + context=structpb.Struct(), + ) + want3.requirements.resources["clusters"].CopyFrom(cluster_sel) + want3.requirements.resources["all-replicas"].CopyFrom(replica_sel) + + # Case 4: existing replica is preserved (stable scheduling). + req4 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + resources={ + "replica-cluster-a": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelReplica", + "metadata": { + "name": "my-model-cluster-a-bc3c4", + "namespace": "ml-team", + "labels": { + "modelplane.ai/replica": "true", + "modelplane.ai/deployment": "my-model", + "modelplane.ai/cluster": "cluster-a", + }, + }, + } + ), + ), + "endpoint-cluster-a": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelEndpoint", + "metadata": {"name": "my-model-cluster-a-bc3c4", "namespace": "ml-team"}, + } + ), + ), + }, + ), + ) + req4.required_resources["clusters"].items.append(fnv1.Resource(resource=resource.dict_to_struct(cluster_a))) + req4.required_resources["all-replicas"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelReplica", + "metadata": { + "name": "my-model-cluster-a-bc3c4", + "namespace": "ml-team", + "labels": { + "modelplane.ai/replica": "true", + "modelplane.ai/deployment": "my-model", + "modelplane.ai/cluster": "cluster-a", + }, + }, + "spec": { + "inferenceClusterRef": {"name": "cluster-a"}, + "workers": { + "topology": {"tensor": 1, "pipeline": 1}, + "count": 1, + "template": { + "spec": { + "containers": [ + {"name": "engine", "image": "vllm/vllm-openai:latest"}, + ] + } + }, + }, + }, + } + ) + ) + ) + + want4 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {"replicas": {"total": 1, "ready": 0}}}), + ), + resources={ + "replica-cluster-a": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelReplica", + "metadata": { + "name": "my-model-cluster-a-bc3c4", + "namespace": "ml-team", + "labels": { + "modelplane.ai/replica": "true", + "modelplane.ai/deployment": "my-model", + "modelplane.ai/cluster": "cluster-a", + }, + }, + "spec": { + "inferenceClusterRef": {"name": "cluster-a"}, + "workers": { + "topology": {"tensor": 1}, + "template": { + "spec": { + "containers": [ + { + "name": "engine", + "image": "vllm/vllm-openai:latest", + "args": ["--model=Qwen/Qwen3-0.6B"], + } + ], + }, + }, + }, + }, + } + ), + ), + "endpoint-cluster-a": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelEndpoint", + "metadata": { + "name": "my-model-cluster-a-bc3c4", + "namespace": "ml-team", + "labels": { + "modelplane.ai/deployment": "my-model", + "modelplane.ai/cluster": "cluster-a", + }, + }, + "spec": { + "url": "http://10.0.0.1/default/my-model-98ad2/v1", + "rewritePath": "/default/my-model-98ad2/", + }, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ReplicasScheduled", + status=fnv1.STATUS_CONDITION_TRUE, + reason="ReplicasCreated", + message="Matched 1 clusters", + ), + fnv1.Condition( + type="ReplicasReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="ModelStarting", + message="0 of 1 ready", + ), + ], + context=structpb.Struct(), + ) + want4.requirements.resources["clusters"].CopyFrom(cluster_sel) + want4.requirements.resources["all-replicas"].CopyFrom(replica_sel) + + cases = [ + Case(name="one ready cluster composes replica and endpoint", req=req1, want=want1), + Case(name="no clusters produces warning", req=req2, want=want2), + Case(name="insufficient capacity produces no replicas", req=req3, want=want3), + Case(name="existing replica is preserved with stable scheduling", req=req4, want=want4), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/functions/compose-model-endpoint/function/__init__.py b/functions/compose-model-endpoint/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-endpoint/function/__version__.py b/functions/compose-model-endpoint/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-model-endpoint/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-endpoint/main.py b/functions/compose-model-endpoint/function/fn.py similarity index 64% rename from functions/compose-model-endpoint/main.py rename to functions/compose-model-endpoint/function/fn.py index 52aea9fe7..d90b26469 100644 --- a/functions/compose-model-endpoint/main.py +++ b/functions/compose-model-endpoint/function/fn.py @@ -11,19 +11,38 @@ import urllib.parse -from crossplane.function import resource, response +import grpc +from crossplane.function import logging, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.modelendpoint import v1alpha1 -from .lib import conditions -from .lib import resource as libresource -from .model.ai.modelplane.modelendpoint import v1alpha1 +BACKEND_RESOURCE_KEY = "backend" -CONDITION_REASON_AVAILABLE = "Available" -CONDITION_REASON_INVALID_URL = "InvalidURL" +# Condition type shared with compose-model-service. Both functions write +# RoutingReady to signal whether traffic can reach the endpoint. +CONDITION_TYPE_ROUTING_READY = "RoutingReady" CONDITION_REASON_BACKEND_CONFIGURED = "BackendConfigured" CONDITION_REASON_WAITING_FOR_BACKEND = "WaitingForBackend" +CONDITION_REASON_INVALID_URL = "InvalidURL" -BACKEND_RESOURCE_KEY = "backend" + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp class Composer: @@ -46,12 +65,14 @@ def parse_url(self): marks the XR not-ready if the URL is invalid.""" parsed = urllib.parse.urlparse(self.xr.spec.url) if not parsed.hostname: - conditions.set_condition( + response.set_conditions( self.rsp, - conditions.CONDITION_TYPE_ROUTING_READY, - False, - CONDITION_REASON_INVALID_URL, - f"spec.url has no host: {self.xr.spec.url}", + resource.Condition( + typ=CONDITION_TYPE_ROUTING_READY, + status="False", + reason=CONDITION_REASON_INVALID_URL, + message=f"spec.url has no host: {self.xr.spec.url}", + ), ) response.warning(self.rsp, f"Invalid spec.url: {self.xr.spec.url}") return None, None @@ -83,21 +104,18 @@ def write_status(self): if backend_name: status.routing = v1alpha1.Routing(backendName=backend_name) - libresource.update_status(self.rsp.desired.composite, status) + resource.update_status(self.rsp.desired.composite, status) def derive_conditions(self): """RoutingReady: the Backend has been observed on the control plane.""" backend_exists = BACKEND_RESOURCE_KEY in self.req.observed.resources - conditions.set_condition( + response.set_conditions( self.rsp, - conditions.CONDITION_TYPE_ROUTING_READY, - backend_exists, - CONDITION_REASON_BACKEND_CONFIGURED if backend_exists else CONDITION_REASON_WAITING_FOR_BACKEND, + resource.Condition( + typ=CONDITION_TYPE_ROUTING_READY, + status="True" if backend_exists else "False", + reason=CONDITION_REASON_BACKEND_CONFIGURED if backend_exists else CONDITION_REASON_WAITING_FOR_BACKEND, + ), ) if backend_exists: self.rsp.desired.resources[BACKEND_RESOURCE_KEY].ready = fnv1.READY_TRUE - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose a Backend from a ModelEndpoint.""" - Composer(req, rsp).compose() diff --git a/functions/compose-model-endpoint/function/main.py b/functions/compose-model-endpoint/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-model-endpoint/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-model-endpoint/lib b/functions/compose-model-endpoint/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-model-endpoint/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-model-endpoint/model b/functions/compose-model-endpoint/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-model-endpoint/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-model-endpoint/pyproject.toml b/functions/compose-model-endpoint/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-model-endpoint/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-model-endpoint/tests/__init__.py b/functions/compose-model-endpoint/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-endpoint/tests/test_fn.py b/functions/compose-model-endpoint/tests/test_fn.py new file mode 100644 index 000000000..64946255e --- /dev/null +++ b/functions/compose-model-endpoint/tests/test_fn.py @@ -0,0 +1,173 @@ +"""Tests for the compose-model-endpoint function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.modelendpoint import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-model-endpoint.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function composes an Envoy Backend from a ModelEndpoint.""" + cases = [ + Case( + name="http URL composes a Backend with the correct IP and default port", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.ModelEndpoint( + metadata=metav1.ObjectMeta(name="test-endpoint", namespace="ml-team"), + spec=v1alpha1.Spec(url="http://34.55.100.10/default/qwen-demo/v1"), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {}}), + ), + resources={ + "backend": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.envoyproxy.io/v1alpha1", + "kind": "Backend", + "metadata": {"namespace": "ml-team"}, + "spec": {"endpoints": [{"ip": {"address": "34.55.100.10", "port": 80}}]}, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="RoutingReady", status=fnv1.STATUS_CONDITION_FALSE, reason="WaitingForBackend" + ), + ], + context=structpb.Struct(), + ), + ), + Case( + name="observed backend sets RoutingReady and status.routing.backendName", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.ModelEndpoint( + metadata=metav1.ObjectMeta(name="test-endpoint", namespace="ml-team"), + spec=v1alpha1.Spec(url="http://34.55.100.10/default/qwen-demo/v1"), + ).model_dump(exclude_none=True, mode="json") + ), + ), + resources={ + "backend": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.envoyproxy.io/v1alpha1", + "kind": "Backend", + "metadata": {"name": "my-backend", "namespace": "ml-team"}, + } + ), + ), + }, + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct({"status": {"routing": {"backendName": "my-backend"}}}), + ), + resources={ + "backend": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.envoyproxy.io/v1alpha1", + "kind": "Backend", + "metadata": {"namespace": "ml-team"}, + "spec": {"endpoints": [{"ip": {"address": "34.55.100.10", "port": 80}}]}, + } + ), + ready=fnv1.READY_TRUE, + ), + }, + ), + conditions=[ + fnv1.Condition( + type="RoutingReady", status=fnv1.STATUS_CONDITION_TRUE, reason="BackendConfigured" + ), + ], + context=structpb.Struct(), + ), + ), + Case( + name="invalid URL produces a warning and no backend", + req=fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + v1alpha1.ModelEndpoint( + metadata=metav1.ObjectMeta(name="test-endpoint", namespace="ml-team"), + spec=v1alpha1.Spec(url="not-a-url"), + ).model_dump(exclude_none=True, mode="json") + ), + ), + ), + ), + want=fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State(), + conditions=[ + fnv1.Condition( + type="RoutingReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="InvalidURL", + message="spec.url has no host: not-a-url", + ), + ], + results=[ + fnv1.Result(severity=fnv1.SEVERITY_WARNING, message="Invalid spec.url: not-a-url"), + ], + context=structpb.Struct(), + ), + ), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/functions/compose-model-replica/function/__init__.py b/functions/compose-model-replica/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-replica/function/__version__.py b/functions/compose-model-replica/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-model-replica/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-replica/main.py b/functions/compose-model-replica/function/fn.py similarity index 71% rename from functions/compose-model-replica/main.py rename to functions/compose-model-replica/function/fn.py index 33683c71d..1a47606af 100644 --- a/functions/compose-model-replica/main.py +++ b/functions/compose-model-replica/function/fn.py @@ -14,14 +14,13 @@ are passed through to the LLMInferenceService. """ -from crossplane.function import request, resource, response +import grpc +from crossplane.function import logging, request, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -from .lib import conditions, defaults, metadata, naming -from .lib.metadata import LABEL_KEY_DEPLOYMENT -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modelreplica import v1alpha1 -from .model.io.crossplane.m.kubernetes.object import v1alpha1 as k8sobjv1alpha1 +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 +from models.ai.modelplane.modelreplica import v1alpha1 +from models.io.crossplane.m.kubernetes.object import v1alpha1 as k8sobjv1alpha1 # Condition types and reasons for the ModelReplica XR. CONDITION_TYPE_MODEL_ACCEPTED = "ModelAccepted" @@ -32,10 +31,49 @@ CONDITION_REASON_DEPLOYING = "Deploying" CONDITION_REASON_ACCEPTED = "Accepted" CONDITION_REASON_SERVING = "Serving" +CONDITION_REASON_MODEL_STARTING = "ModelStarting" # Composed resource key for the model serving resource. MODEL_RESOURCE_KEY = "model-serving" +# Label key written by compose-model-deployment, read here to derive the +# LLMInferenceService name on the remote cluster. +_LABEL_DEPLOYMENT = "modelplane.ai/deployment" + +# Namespace for LLMInferenceService on remote clusters. +_NAMESPACE_REMOTE = "default" + + +def _inference_cluster( + ic: icv1alpha1.InferenceCluster, +) -> icv1alpha1.InferenceCluster: + """Return a copy with status fields defaulted.""" + ic = ic.model_copy(deep=True) + ic.status = ic.status or icv1alpha1.Status() + ic.status.providerConfigRef = ic.status.providerConfigRef or icv1alpha1.ProviderConfigRef() + ic.status.gateway = ic.status.gateway or icv1alpha1.Gateway() + ic.status.capacity = ic.status.capacity or icv1alpha1.Capacity() + ic.status.capacity.gpuPools = ic.status.capacity.gpuPools or [] + return ic + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp + class Composer: def __init__(self, req, rsp): @@ -63,20 +101,36 @@ def resolve_inputs(self): ic_dict = request.get_required_resource(self.req, "cluster") if ic_dict is None: - conditions.set_condition( - self.rsp, CONDITION_TYPE_MODEL_ACCEPTED, False, CONDITION_REASON_WAITING_FOR_CLUSTER + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_MODEL_ACCEPTED, status="False", reason=CONDITION_REASON_WAITING_FOR_CLUSTER + ), + ) + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_MODEL_READY, status="False", reason=CONDITION_REASON_WAITING_FOR_MODEL + ), ) - conditions.set_condition(self.rsp, CONDITION_TYPE_MODEL_READY, False, CONDITION_REASON_WAITING_FOR_MODEL) response.normal(self.rsp, "Waiting for cluster to be resolved") return False - self.ic = defaults.inference_cluster(icv1alpha1.InferenceCluster.model_validate(ic_dict)) + self.ic = _inference_cluster(icv1alpha1.InferenceCluster.model_validate(ic_dict)) if not self.ic.status.providerConfigRef.name: - conditions.set_condition( - self.rsp, CONDITION_TYPE_MODEL_ACCEPTED, False, CONDITION_REASON_WAITING_FOR_CLUSTER + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_MODEL_ACCEPTED, status="False", reason=CONDITION_REASON_WAITING_FOR_CLUSTER + ), + ) + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_MODEL_READY, status="False", reason=CONDITION_REASON_WAITING_FOR_MODEL + ), ) - conditions.set_condition(self.rsp, CONDITION_TYPE_MODEL_READY, False, CONDITION_REASON_WAITING_FOR_MODEL) response.normal(self.rsp, "Waiting for cluster providerConfigRef") return False @@ -159,7 +213,7 @@ def compose_model_serving(self): "kind": "LLMInferenceService", "metadata": { "name": self.llmis_name(), - "namespace": metadata.NAMESPACE_REMOTE, + "namespace": _NAMESPACE_REMOTE, }, "spec": llmis_spec, }, @@ -205,8 +259,8 @@ def llmis_name(self): the same deployment land at the same path on every remote gateway. """ labels = self.xr.metadata.labels or {} - deployment_name = labels.get(LABEL_KEY_DEPLOYMENT, self.xr.metadata.name) - return naming.llmis_name(deployment_name) + deployment_name = labels.get(_LABEL_DEPLOYMENT, self.xr.metadata.name) + return resource.child_name(deployment_name) def derive_conditions(self): """Derive ModelAccepted and ModelReady conditions.""" @@ -228,26 +282,35 @@ def derive_conditions(self): obj = k8sobjv1alpha1.Object.model_validate(resource.struct_to_dict(serving_observed.resource)) serving_accepted = bool(obj.status and obj.status.atProvider and obj.status.atProvider.manifest) - serving_ready = conditions.has_condition(self.req, MODEL_RESOURCE_KEY, "Ready") + serving_ready = ( + resource.get_condition(self.req.observed.resources.get(MODEL_RESOURCE_KEY), "Ready").status == "True" + ) # ModelAccepted: the remote resource was created on the cluster. accepted_reason = CONDITION_REASON_ACCEPTED if serving_accepted else CONDITION_REASON_DEPLOYING - conditions.set_condition(self.rsp, CONDITION_TYPE_MODEL_ACCEPTED, serving_accepted, accepted_reason) + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_MODEL_ACCEPTED, + status="True" if serving_accepted else "False", + reason=accepted_reason, + ), + ) # ModelReady: the model is actually serving traffic. if serving_ready: ready_reason = CONDITION_REASON_SERVING elif serving_accepted: - ready_reason = conditions.CONDITION_REASON_MODEL_STARTING + ready_reason = CONDITION_REASON_MODEL_STARTING else: ready_reason = CONDITION_REASON_WAITING_FOR_MODEL - conditions.set_condition(self.rsp, CONDITION_TYPE_MODEL_READY, serving_ready, ready_reason) + response.set_conditions( + self.rsp, + resource.Condition( + typ=CONDITION_TYPE_MODEL_READY, status="True" if serving_ready else "False", reason=ready_reason + ), + ) # Per-resource readiness. if MODEL_RESOURCE_KEY in self.rsp.desired.resources and serving_ready: self.rsp.desired.resources[MODEL_RESOURCE_KEY].ready = fnv1.READY_TRUE - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose model serving resources on the remote cluster.""" - Composer(req, rsp).compose() diff --git a/functions/compose-model-replica/function/main.py b/functions/compose-model-replica/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-model-replica/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-model-replica/lib b/functions/compose-model-replica/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-model-replica/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-model-replica/model b/functions/compose-model-replica/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-model-replica/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-model-replica/pyproject.toml b/functions/compose-model-replica/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-model-replica/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-model-replica/tests/__init__.py b/functions/compose-model-replica/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-replica/tests/test_fn.py b/functions/compose-model-replica/tests/test_fn.py new file mode 100644 index 000000000..3bb013526 --- /dev/null +++ b/functions/compose-model-replica/tests/test_fn.py @@ -0,0 +1,263 @@ +"""Tests for the compose-model-replica function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.modelreplica import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-model-replica.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function composes an LLMInferenceService on a remote cluster.""" + + xr = v1alpha1.ModelReplica( + metadata=metav1.ObjectMeta( + name="test-replica", + namespace="ml-team", + labels={ + "modelplane.ai/deployment": "my-deployment", + "modelplane.ai/cluster": "cluster-a", + }, + ), + spec=v1alpha1.SpecModel( + inferenceClusterRef=v1alpha1.InferenceClusterRef(name="cluster-a"), + workers=v1alpha1.Workers( + topology=v1alpha1.Topology(tensor=1), + template=v1alpha1.Template( + spec=v1alpha1.Spec( + containers=[ + v1alpha1.Container( + name="engine", + image="vllm/vllm-openai:latest", + args=["--model=Qwen/Qwen3-0.6B"], + ), + ], + ), + ), + ), + ), + ).model_dump(exclude_none=True, mode="json") + + cluster_requirement = fnv1.ResourceSelector( + api_version="modelplane.ai/v1alpha1", + kind="InferenceCluster", + match_name="cluster-a", + ) + + # Case 1: cluster resolved with providerConfigRef — composes LLMInferenceService. + req1 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req1.required_resources["cluster"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "InferenceCluster", + "metadata": {"name": "cluster-a"}, + "spec": { + "cluster": {"source": "Existing", "existing": {"secretRef": {"name": "k"}}}, + }, + "status": { + "providerConfigRef": {"name": "cluster-a-pc"}, + "gateway": {"address": "10.0.0.1"}, + }, + } + ) + ) + ) + + want1 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + resources={ + "model-serving": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "kubernetes.m.crossplane.io/v1alpha1", + "kind": "Object", + "spec": { + "providerConfigRef": { + "kind": "ClusterProviderConfig", + "name": "cluster-a-pc", + }, + "readiness": {"policy": "DeriveFromObject"}, + "forProvider": { + "manifest": { + "apiVersion": "serving.kserve.io/v1alpha1", + "kind": "LLMInferenceService", + "metadata": { + "name": "my-deployment-1154c", + "namespace": "default", + }, + "spec": { + "model": {"uri": "hf://Qwen/Qwen3-0.6B"}, + "replicas": 1, + "template": { + "containers": [ + { + "name": "main", + "image": "vllm/vllm-openai:latest", + "args": [], + "securityContext": { + "runAsUser": 0, + "runAsNonRoot": False, + }, + "resources": { + "limits": {"nvidia.com/gpu": "1"}, + }, + } + ], + }, + "router": {"gateway": {}, "route": {}}, + }, + }, + }, + }, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="ModelAccepted", + status=fnv1.STATUS_CONDITION_FALSE, + reason="Deploying", + ), + fnv1.Condition( + type="ModelReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="WaitingForModel", + ), + ], + results=[ + fnv1.Result( + severity=fnv1.SEVERITY_NORMAL, + message="Composing vllm/vllm-openai:latest on cluster-a", + ), + ], + context=structpb.Struct(), + ) + want1.requirements.resources["cluster"].CopyFrom(cluster_requirement) + + # Case 2: cluster not resolved — early return with conditions. + req2 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + + want2 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State(), + conditions=[ + fnv1.Condition( + type="ModelAccepted", + status=fnv1.STATUS_CONDITION_FALSE, + reason="WaitingForCluster", + ), + fnv1.Condition( + type="ModelReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="WaitingForModel", + ), + ], + results=[ + fnv1.Result( + severity=fnv1.SEVERITY_NORMAL, + message="Waiting for cluster to be resolved", + ), + ], + context=structpb.Struct(), + ) + want2.requirements.resources["cluster"].CopyFrom(cluster_requirement) + + # Case 3: cluster resolved but no providerConfigRef — early return. + req3 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req3.required_resources["cluster"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "InferenceCluster", + "metadata": {"name": "cluster-a"}, + "spec": { + "cluster": {"source": "Existing", "existing": {"secretRef": {"name": "k"}}}, + }, + } + ) + ) + ) + + want3 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State(), + conditions=[ + fnv1.Condition( + type="ModelAccepted", + status=fnv1.STATUS_CONDITION_FALSE, + reason="WaitingForCluster", + ), + fnv1.Condition( + type="ModelReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="WaitingForModel", + ), + ], + results=[ + fnv1.Result( + severity=fnv1.SEVERITY_NORMAL, + message="Waiting for cluster providerConfigRef", + ), + ], + context=structpb.Struct(), + ) + want3.requirements.resources["cluster"].CopyFrom(cluster_requirement) + + cases = [ + Case(name="cluster ready composes LLMInferenceService via Object", req=req1, want=want1), + Case(name="cluster not resolved returns waiting conditions", req=req2, want=want2), + Case(name="cluster without providerConfigRef returns waiting conditions", req=req3, want=want3), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/functions/compose-model-service/function/__init__.py b/functions/compose-model-service/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-service/function/__version__.py b/functions/compose-model-service/function/__version__.py new file mode 100644 index 000000000..1c8a94c50 --- /dev/null +++ b/functions/compose-model-service/function/__version__.py @@ -0,0 +1,3 @@ +"""Version is set at build time by hatch-vcs.""" + +__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-service/main.py b/functions/compose-model-service/function/fn.py similarity index 61% rename from functions/compose-model-service/main.py rename to functions/compose-model-service/function/fn.py index 94a1fefd1..591737561 100644 --- a/functions/compose-model-service/main.py +++ b/functions/compose-model-service/function/fn.py @@ -12,14 +12,13 @@ providers can coexist with different rewrite targets. """ -from crossplane.function import request, resource, response +import grpc +from crossplane.function import logging, request, resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -from .lib import conditions, defaults, metadata -from .lib import resource as libresource -from .model.ai.modelplane.inferencegateway import v1alpha1 as igwv1alpha1 -from .model.ai.modelplane.modelendpoint import v1alpha1 as mev1alpha1 -from .model.ai.modelplane.modelservice import v1alpha1 +from crossplane.function.proto.v1 import run_function_pb2_grpc as grpcv1 +from models.ai.modelplane.inferencegateway import v1alpha1 as igwv1alpha1 +from models.ai.modelplane.modelendpoint import v1alpha1 as mev1alpha1 +from models.ai.modelplane.modelservice import v1alpha1 CONDITION_TYPE_ENDPOINTS_RESOLVED = "EndpointsResolved" CONDITION_REASON_RESOLVED = "Resolved" @@ -27,6 +26,59 @@ CONDITION_REASON_WAITING_FOR_GATEWAY = "WaitingForGateway" CONDITION_REASON_ROUTE_CONFIGURED = "RouteConfigured" CONDITION_REASON_CONFIGURING = "Configuring" +CONDITION_TYPE_ROUTING_READY = "RoutingReady" + +# The control plane gateway name and namespace. ModelService composes +# HTTPRoutes that reference this gateway as a parentRef. +_GATEWAY_NAME = "modelplane" +_NAMESPACE_SYSTEM = "modelplane-system" + +# Scheme for user-facing service URLs. +_GATEWAY_SCHEME = "http" + + +def _inference_gateway( + gw: igwv1alpha1.InferenceGateway, +) -> igwv1alpha1.InferenceGateway: + """Return a copy with status fields defaulted.""" + gw = gw.model_copy(deep=True) + gw.status = gw.status or igwv1alpha1.Status() + return gw + + +def _has_parent_condition(req: fnv1.RunFunctionRequest, name: str, cond: str) -> bool: + """Check a Gateway API condition nested under status.parents[].conditions. + + Gateway API resources (HTTPRoute, etc.) nest route status under + status.parents[].conditions instead of top-level status.conditions. + """ + observed = req.observed.resources.get(name) + if observed is None: + return False + d = resource.struct_to_dict(observed.resource) + for p in d.get("status", {}).get("parents", []): + for c in p.get("conditions", []): + if c.get("type") == cond and c.get("status") == "True": + return True + return False + + +class FunctionRunner(grpcv1.FunctionRunnerService): + """A FunctionRunner handles gRPC RunFunctionRequests.""" + + def __init__(self): + """Create a new FunctionRunner.""" + self.log = logging.get_logger() + + async def RunFunction(self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1.RunFunctionResponse: + """Run the function.""" + log = self.log.bind(tag=req.meta.tag) + log.info("Running function") + + rsp = response.to(req) + c = Composer(req, rsp) + c.compose() + return rsp class Composer: @@ -65,9 +117,7 @@ def resolve_inputs(self) -> bool: ) gw_dict = request.get_required_resource(self.req, "inference-gateway") - self.gateway = ( - defaults.inference_gateway(igwv1alpha1.InferenceGateway.model_validate(gw_dict)) if gw_dict else None - ) + self.gateway = _inference_gateway(igwv1alpha1.InferenceGateway.model_validate(gw_dict)) if gw_dict else None # Gather matched endpoints from every selector entry. seen_names: set[str] = set() @@ -81,12 +131,14 @@ def resolve_inputs(self) -> bool: self.endpoints.append(ep) if not self.endpoints: - conditions.set_condition( + response.set_conditions( self.rsp, - CONDITION_TYPE_ENDPOINTS_RESOLVED, - False, - CONDITION_REASON_NO_ENDPOINTS, - "No ModelEndpoints matched the configured selectors", + resource.Condition( + typ=CONDITION_TYPE_ENDPOINTS_RESOLVED, + status="False", + reason=CONDITION_REASON_NO_ENDPOINTS, + message="No ModelEndpoints matched the configured selectors", + ), ) response.warning(self.rsp, "No ModelEndpoints matched the configured selectors") return False @@ -97,12 +149,14 @@ def resolve_inputs(self) -> bool: if waiting > 0: msg += f"; {waiting} waiting for Backend" - conditions.set_condition( + response.set_conditions( self.rsp, - CONDITION_TYPE_ENDPOINTS_RESOLVED, - True, - CONDITION_REASON_RESOLVED, - msg, + resource.Condition( + typ=CONDITION_TYPE_ENDPOINTS_RESOLVED, + status="True", + reason=CONDITION_REASON_RESOLVED, + message=msg, + ), ) return True @@ -154,7 +208,7 @@ def compose_httproute(self): rule["backendRefs"] = backend_refs httproute_spec = { - "parentRefs": [{"name": metadata.GATEWAY_NAME, "namespace": metadata.NAMESPACE_SYSTEM}], + "parentRefs": [{"name": _GATEWAY_NAME, "namespace": _NAMESPACE_SYSTEM}], "rules": [rule], } @@ -172,38 +226,35 @@ def write_status(self): status = v1alpha1.Status() gateway_ip = self.gateway.status.address if self.gateway else None if gateway_ip: - status.address = ( - f"{metadata.GATEWAY_SCHEME}://{gateway_ip}/{self.xr.metadata.namespace}/{self.xr.metadata.name}" - ) - libresource.update_status(self.rsp.desired.composite, status) + status.address = f"{_GATEWAY_SCHEME}://{gateway_ip}/{self.xr.metadata.namespace}/{self.xr.metadata.name}" + resource.update_status(self.rsp.desired.composite, status) def derive_conditions(self): """RoutingReady: HTTPRoute is composed and Accepted with backends.""" if "httproute" not in self.rsp.desired.resources: - conditions.set_condition( + response.set_conditions( self.rsp, - conditions.CONDITION_TYPE_ROUTING_READY, - False, - CONDITION_REASON_WAITING_FOR_GATEWAY, + resource.Condition( + typ=CONDITION_TYPE_ROUTING_READY, + status="False", + reason=CONDITION_REASON_WAITING_FOR_GATEWAY, + ), ) return backend_refs_observed = any( ep.status and ep.status.routing and ep.status.routing.backendName for ep in self.endpoints ) - route_ready = conditions.has_parent_condition(self.req, "httproute", "Accepted") and backend_refs_observed + route_ready = _has_parent_condition(self.req, "httproute", "Accepted") and backend_refs_observed if route_ready: self.rsp.desired.resources["httproute"].ready = fnv1.READY_TRUE - conditions.set_condition( + response.set_conditions( self.rsp, - conditions.CONDITION_TYPE_ROUTING_READY, - route_ready, - CONDITION_REASON_ROUTE_CONFIGURED if route_ready else CONDITION_REASON_CONFIGURING, + resource.Condition( + typ=CONDITION_TYPE_ROUTING_READY, + status="True" if route_ready else "False", + reason=CONDITION_REASON_ROUTE_CONFIGURED if route_ready else CONDITION_REASON_CONFIGURING, + ), ) - - -def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): - """Compose an HTTPRoute from a ModelService.""" - Composer(req, rsp).compose() diff --git a/functions/compose-model-service/function/main.py b/functions/compose-model-service/function/main.py new file mode 100644 index 000000000..abeb3a672 --- /dev/null +++ b/functions/compose-model-service/function/main.py @@ -0,0 +1,41 @@ +"""The composition function's main CLI.""" + +import click +from crossplane.function import logging, runtime + +from function import fn + + +@click.command() +@click.option("--debug", "-d", is_flag=True, help="Emit debug logs.") +@click.option( + "--address", + default="0.0.0.0:9443", + show_default=True, + help="Address at which to listen for gRPC connections", +) +@click.option("--tls-certs-dir", help="Serve using mTLS certificates.", envvar="TLS_SERVER_CERTS_DIR") +@click.option( + "--insecure", + is_flag=True, + help="Run without mTLS credentials. If you supply this flag --tls-certs-dir will be ignored.", +) +def cli(debug: bool, address: str, tls_certs_dir: str, insecure: bool) -> None: # noqa:FBT001 + """A Crossplane composition function.""" + try: + level = logging.Level.INFO + if debug: + level = logging.Level.DEBUG + logging.configure(level=level) + runtime.serve( + fn.FunctionRunner(), + address, + creds=runtime.load_credentials(tls_certs_dir), + insecure=insecure, + ) + except Exception as e: + click.echo(f"Cannot run function: {e}") + + +if __name__ == "__main__": + cli() diff --git a/functions/compose-model-service/lib b/functions/compose-model-service/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/functions/compose-model-service/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/functions/compose-model-service/model b/functions/compose-model-service/model deleted file mode 120000 index 6ff11914c..000000000 --- a/functions/compose-model-service/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/functions/compose-model-service/pyproject.toml b/functions/compose-model-service/pyproject.toml new file mode 100644 index 000000000..9ebe5f167 --- /dev/null +++ b/functions/compose-model-service/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "function" +description = "A Crossplane composition function." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" +dependencies = [ + "crossplane-function-sdk-python==0.12.0", + "click==8.3.2", + "grpcio>=1.73.1", + "crossplane-models @ file:./../../schemas/python", +] +dynamic = ["version"] + +[project.scripts] +function = "function.main:cli" + +[tool.hatch.build.targets.wheel] +packages = ["function"] + +[tool.hatch.version] +path = "function/__version__.py" +validate-bump = false + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/functions/compose-model-service/tests/__init__.py b/functions/compose-model-service/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functions/compose-model-service/tests/test_fn.py b/functions/compose-model-service/tests/test_fn.py new file mode 100644 index 000000000..c68432317 --- /dev/null +++ b/functions/compose-model-service/tests/test_fn.py @@ -0,0 +1,282 @@ +"""Tests for the compose-model-service function.""" + +import dataclasses +import unittest + +from crossplane.function import logging, resource +from crossplane.function.proto.v1 import run_function_pb2 as fnv1 +from function import fn +from google.protobuf import duration_pb2 as durationpb +from google.protobuf import json_format +from google.protobuf import struct_pb2 as structpb +from models.ai.modelplane.modelservice import v1alpha1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 + + +@dataclasses.dataclass +class Case: + """A test case for compose-model-service.""" + + name: str + req: fnv1.RunFunctionRequest + want: fnv1.RunFunctionResponse + + +def setUpModule() -> None: + logging.configure(level=logging.Level.DISABLED) + + +class TestFunctionRunner(unittest.IsolatedAsyncioTestCase): + """Tests for FunctionRunner.RunFunction.""" + + @classmethod + def setUpClass(cls) -> None: + cls.runner = fn.FunctionRunner() + + async def test_compose(self) -> None: + """The function composes an HTTPRoute from a ModelService.""" + + xr = v1alpha1.ModelService( + metadata=metav1.ObjectMeta(name="test-service", namespace="ml-team"), + spec=v1alpha1.Spec( + endpoints=[v1alpha1.Endpoint(selector=v1alpha1.Selector(matchLabels={"app": "model"}))], + ), + ).model_dump(exclude_none=True, mode="json") + + # Case 1: endpoints with ready backends compose HTTPRoute with backendRefs. + req1 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req1.required_resources["inference-gateway"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "InferenceGateway", + "metadata": {"name": "default"}, + "spec": {"backend": "EnvoyGateway"}, + "status": {"address": "34.55.100.10"}, + } + ) + ) + ) + req1.required_resources["endpoints-0"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelEndpoint", + "metadata": {"name": "ep-1", "namespace": "ml-team"}, + "spec": {"url": "http://10.0.0.1/default/model/v1", "rewritePath": "/default/model/"}, + "status": {"routing": {"backendName": "backend-1"}}, + } + ) + ) + ) + + want1 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + {"status": {"address": "http://34.55.100.10/ml-team/test-service"}} + ), + ), + resources={ + "httproute": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": {"namespace": "ml-team"}, + "spec": { + "parentRefs": [{"name": "modelplane", "namespace": "modelplane-system"}], + "rules": [ + { + "matches": [ + {"path": {"type": "PathPrefix", "value": "/ml-team/test-service/"}} + ], + "backendRefs": [ + { + "group": "gateway.envoyproxy.io", + "kind": "Backend", + "name": "backend-1", + "port": 80, + "weight": 1, + "filters": [ + { + "type": "URLRewrite", + "urlRewrite": { + "path": { + "type": "ReplacePrefixMatch", + "replacePrefixMatch": "/default/model/", + }, + }, + } + ], + }, + ], + } + ], + }, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="EndpointsResolved", + status=fnv1.STATUS_CONDITION_TRUE, + reason="Resolved", + message="Matched 1 endpoint(s)", + ), + fnv1.Condition( + type="RoutingReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="Configuring", + ), + ], + context=structpb.Struct(), + ) + want1.requirements.resources["inference-gateway"].CopyFrom( + fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="InferenceGateway", match_name="default") + ) + sel0 = fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="ModelEndpoint") + sel0.match_labels.labels.update({"app": "model"}) + want1.requirements.resources["endpoints-0"].CopyFrom(sel0) + + # Case 2: no endpoints produces warning. + req2 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req2.required_resources["endpoints-0"].SetInParent() + + want2 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State(), + conditions=[ + fnv1.Condition( + type="EndpointsResolved", + status=fnv1.STATUS_CONDITION_FALSE, + reason="NoEndpoints", + message="No ModelEndpoints matched the configured selectors", + ), + ], + results=[ + fnv1.Result( + severity=fnv1.SEVERITY_WARNING, + message="No ModelEndpoints matched the configured selectors", + ), + ], + context=structpb.Struct(), + ) + want2.requirements.resources["inference-gateway"].CopyFrom( + fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="InferenceGateway", match_name="default") + ) + sel0_2 = fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="ModelEndpoint") + sel0_2.match_labels.labels.update({"app": "model"}) + want2.requirements.resources["endpoints-0"].CopyFrom(sel0_2) + + # Case 3: endpoint without backend name — route has no backendRefs. + req3 = fnv1.RunFunctionRequest( + observed=fnv1.State( + composite=fnv1.Resource(resource=resource.dict_to_struct(xr)), + ), + ) + req3.required_resources["inference-gateway"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "InferenceGateway", + "metadata": {"name": "default"}, + "spec": {"backend": "EnvoyGateway"}, + "status": {"address": "34.55.100.10"}, + } + ) + ) + ) + req3.required_resources["endpoints-0"].items.append( + fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "modelplane.ai/v1alpha1", + "kind": "ModelEndpoint", + "metadata": {"name": "ep-1", "namespace": "ml-team"}, + "spec": {"url": "http://10.0.0.1/default/model/v1"}, + } + ) + ) + ) + + want3 = fnv1.RunFunctionResponse( + meta=fnv1.ResponseMeta(ttl=durationpb.Duration(seconds=60)), + desired=fnv1.State( + composite=fnv1.Resource( + resource=resource.dict_to_struct( + {"status": {"address": "http://34.55.100.10/ml-team/test-service"}} + ), + ), + resources={ + "httproute": fnv1.Resource( + resource=resource.dict_to_struct( + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": {"namespace": "ml-team"}, + "spec": { + "parentRefs": [{"name": "modelplane", "namespace": "modelplane-system"}], + "rules": [ + { + "matches": [ + {"path": {"type": "PathPrefix", "value": "/ml-team/test-service/"}} + ], + } + ], + }, + } + ), + ), + }, + ), + conditions=[ + fnv1.Condition( + type="EndpointsResolved", + status=fnv1.STATUS_CONDITION_TRUE, + reason="Resolved", + message="Matched 1 endpoint(s); 1 waiting for Backend", + ), + fnv1.Condition( + type="RoutingReady", + status=fnv1.STATUS_CONDITION_FALSE, + reason="Configuring", + ), + ], + context=structpb.Struct(), + ) + want3.requirements.resources["inference-gateway"].CopyFrom( + fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="InferenceGateway", match_name="default") + ) + sel0_3 = fnv1.ResourceSelector(api_version="modelplane.ai/v1alpha1", kind="ModelEndpoint") + sel0_3.match_labels.labels.update({"app": "model"}) + want3.requirements.resources["endpoints-0"].CopyFrom(sel0_3) + + cases = [ + Case(name="endpoints with ready backends compose HTTPRoute with backendRefs", req=req1, want=want1), + Case(name="no endpoints produces warning and EndpointsResolved=False", req=req2, want=want2), + Case(name="endpoint without backend composes HTTPRoute without backendRefs", req=req3, want=want3), + ] + + for case in cases: + with self.subTest(case.name): + got = await self.runner.RunFunction(case.req, None) + self.assertEqual( + json_format.MessageToDict(case.want), + json_format.MessageToDict(got), + "-want, +got", + ) diff --git a/lib/conditions.py b/lib/conditions.py deleted file mode 100644 index ae81f82f4..000000000 --- a/lib/conditions.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Condition helpers for composition functions.""" - -from crossplane.function import resource -from crossplane.function.proto.v1 import run_function_pb2 as fnv1 - -# Condition types shared across multiple functions. -CONDITION_TYPE_ROUTING_READY = "RoutingReady" - -# Condition reasons shared across multiple functions. -CONDITION_REASON_MODEL_STARTING = "ModelStarting" - - -def has_condition(req: fnv1.RunFunctionRequest, name: str, cond: str) -> bool: - """Check if an observed composed resource has a condition set to True. - - Uses the SDK's resource.get_condition which reads status.conditions from - the protobuf Struct representation of the resource. - """ - observed = req.observed.resources.get(name) - if observed is None: - return False - return resource.get_condition(observed.resource, cond).status == "True" - - -def has_parent_condition(req: fnv1.RunFunctionRequest, name: str, cond: str) -> bool: - """Check a Gateway API condition nested under status.parents[].conditions. - - Gateway API resources (HTTPRoute, etc.) nest route status under - status.parents[].conditions instead of top-level status.conditions. - """ - observed = req.observed.resources.get(name) - if observed is None: - return False - d = resource.struct_to_dict(observed.resource) - for p in d.get("status", {}).get("parents", []): - for c in p.get("conditions", []): - if c.get("type") == cond and c.get("status") == "True": - return True - return False - - -def set_condition( - rsp: fnv1.RunFunctionResponse, - type: str, # noqa: A002 - shadows builtin, but matches protobuf field name - status: bool, - reason: str, - message: str = "", -) -> None: - """Set a custom condition on the XR. - - A composable, single-condition setter. Call once per condition rather than - bundling all conditions into one function with a large parameter list. - """ - rsp.conditions.append( - fnv1.Condition( - type=type, - status=(fnv1.STATUS_CONDITION_TRUE if status else fnv1.STATUS_CONDITION_FALSE), - reason=reason, - message=message, - target=fnv1.TARGET_COMPOSITE, - ) - ) diff --git a/lib/defaults.py b/lib/defaults.py deleted file mode 100644 index 027361585..000000000 --- a/lib/defaults.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Populate default values on Pydantic models. - -Optional nested fields (status sub-objects, optional spec groups) require -guard chains at every access site. These functions return a deep copy with -all intermediate Optional fields populated with their zero values, so -downstream code can access fields directly. -""" - -from ..model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from ..model.ai.modelplane.inferencegateway import v1alpha1 as igwv1alpha1 -from ..model.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 - - -def inference_cluster( - ic: icv1alpha1.InferenceCluster, -) -> icv1alpha1.InferenceCluster: - """Return a copy with status fields defaulted.""" - ic = ic.model_copy(deep=True) - ic.status = ic.status or icv1alpha1.Status() - ic.status.providerConfigRef = ic.status.providerConfigRef or icv1alpha1.ProviderConfigRef() - ic.status.gateway = ic.status.gateway or icv1alpha1.Gateway() - ic.status.capacity = ic.status.capacity or icv1alpha1.Capacity() - ic.status.capacity.gpuPools = ic.status.capacity.gpuPools or [] - return ic - - -def model_replica( - r: mrv1alpha1.ModelReplica, -) -> mrv1alpha1.ModelReplica: - """Return a copy with status fields defaulted.""" - r = r.model_copy(deep=True) - r.metadata = r.metadata or mrv1alpha1.ModelReplica().metadata - return r - - -def inference_gateway( - gw: igwv1alpha1.InferenceGateway, -) -> igwv1alpha1.InferenceGateway: - """Return a copy with status fields defaulted.""" - gw = gw.model_copy(deep=True) - gw.status = gw.status or igwv1alpha1.Status() - return gw diff --git a/lib/helm.py b/lib/helm.py deleted file mode 100644 index f31e1fb16..000000000 --- a/lib/helm.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Helm Release builder for composition functions.""" - -from ..model.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 -from ..model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 - - -def helm_release( - chart: str, - repo: str, - version: str, - namespace: str, - provider_config: str, - values: dict | None = None, - labels: dict | None = None, - metadata_namespace: str | None = None, -) -> helmv1beta1.Release: - """Build a Helm Release targeting a remote (or local) cluster. - - Args: - chart: The Helm chart name. - repo: The chart repository URL. - version: The chart version. - namespace: The namespace to install the chart into on the target cluster. - provider_config: Name of the ProviderConfig to use. - values: Optional Helm values dict. - labels: Optional labels for the Release metadata. - metadata_namespace: Optional namespace for the Release resource itself. - Set this explicitly when composing from a cluster-scoped XR, since - cluster-scoped XRs don't auto-populate namespace on composed - namespaced resources. - """ - metadata = None - if labels or metadata_namespace: - metadata = metav1.ObjectMeta(namespace=metadata_namespace, labels=labels) - - release = helmv1beta1.Release( - metadata=metadata, - spec=helmv1beta1.Spec( - providerConfigRef=helmv1beta1.ProviderConfigRef( - kind="ProviderConfig", - name=provider_config, - ), - forProvider=helmv1beta1.ForProvider( - chart=helmv1beta1.Chart( - name=chart, - repository=repo, - version=version, - ), - namespace=namespace, - ), - ), - ) - if values: - release.spec.forProvider.values = values - return release diff --git a/lib/k8s.py b/lib/k8s.py deleted file mode 100644 index f9426056b..000000000 --- a/lib/k8s.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Kubernetes Object builder for composition functions.""" - -from ..model.io.crossplane.m.kubernetes.object import v1alpha1 as k8sobjv1alpha1 -from ..model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 - - -def k8s_object( - provider_config: str, - manifest: dict, - metadata: metav1.ObjectMeta | None = None, - management_policies: list | None = None, -) -> k8sobjv1alpha1.Object: - """Build a provider-kubernetes Object wrapping an arbitrary manifest. - - Args: - provider_config: Name of the ProviderConfig to use. - manifest: The Kubernetes resource manifest to wrap. - metadata: Optional metadata for the Object resource itself. - management_policies: Optional management policies (e.g. - ["Create", "Observe", "Update"] to skip deletion). - """ - obj = k8sobjv1alpha1.Object( - metadata=metadata, - spec=k8sobjv1alpha1.Spec( - providerConfigRef=k8sobjv1alpha1.ProviderConfigRef( - kind="ProviderConfig", - name=provider_config, - ), - forProvider=k8sobjv1alpha1.ForProvider( - manifest=manifest, - ), - ), - ) - if management_policies: - obj.spec.managementPolicies = management_policies - return obj diff --git a/lib/keda.py b/lib/keda.py deleted file mode 100644 index f401a7829..000000000 --- a/lib/keda.py +++ /dev/null @@ -1,23 +0,0 @@ -"""KEDA configuration for backend clusters. - -The KServe backend installs KEDA for autoscaling. This module provides -shared configuration and a helper to compose the Helm release. -""" - -from ..model.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 -from . import helm - -NAMESPACE = "keda" -CHART = "keda" -REPO = "https://kedacore.github.io/charts" - - -def helm_release(version: str, provider_config: str) -> helmv1beta1.Release: - """Build a KEDA Helm release for a backend cluster.""" - return helm.helm_release( - chart=CHART, - repo=REPO, - version=version, - namespace=NAMESPACE, - provider_config=provider_config, - ) diff --git a/lib/metadata.py b/lib/metadata.py deleted file mode 100644 index 546cf84fe..000000000 --- a/lib/metadata.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Kubernetes metadata constants shared across composition functions. - -Labels, namespaces, and resource names used by multiple functions or that -benefit from a single source of truth even when used by only one. -""" - -# Label keys. All in the modelplane.ai domain. -LABEL_KEY_CLUSTER = "modelplane.ai/cluster" -LABEL_KEY_DEPLOYMENT = "modelplane.ai/deployment" -LABEL_KEY_GPU = "modelplane.ai/gpu" -LABEL_KEY_POOL = "modelplane.ai/pool" -LABEL_KEY_RELEASE = "modelplane.ai/release" -LABEL_KEY_REPLICA = "modelplane.ai/replica" -LABEL_KEY_RESOURCE = "modelplane.ai/resource" - -# Label values for presence labels (key=true). -LABEL_VALUE_CLUSTER = "true" -LABEL_VALUE_REPLICA = "true" - -# Namespaces. -NAMESPACE_SYSTEM = "modelplane-system" -NAMESPACE_REMOTE = "default" - -# The control plane gateway name. Used as the Gateway resource name, -# the MetalLB IP pool name, and the HTTPRoute parentRef. -GATEWAY_NAME = "modelplane" - -# Scheme used for gateway-facing URLs. Inference traffic between the -# control plane gateway and remote cluster gateways uses plain HTTP; -# TLS terminates at the edge. -GATEWAY_SCHEME = "http" diff --git a/lib/naming.py b/lib/naming.py deleted file mode 100644 index bb48676bc..000000000 --- a/lib/naming.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Name generation for composed resources. - -All Kubernetes resource names must be valid DNS labels (at most 63 -characters). Names built by combining user-supplied components (e.g. -deployment + cluster) can exceed this limit. Every function in this -module uses dns_name() to produce a safe name: the full string is used -when it fits; otherwise the name is truncated and a 5-character hash -suffix is appended to preserve uniqueness. -""" - -import hashlib - -DNS_LABEL_MAX = 63 -_HASH_LEN = 5 - - -def dns_name(*parts: str, sep: str = "-") -> str: - """Build a DNS-safe name from one or more parts joined by sep. - - A deterministic hash suffix is always appended so that names are - visually consistent regardless of length. The hash is the first - _HASH_LEN hex characters of a SHA-256 digest of the full - (untruncated) joined name. The prefix is truncated to fit within - DNS_LABEL_MAX. - """ - full = sep.join(parts) - h = hashlib.sha256(full.encode()).hexdigest()[:_HASH_LEN] - # Truncate, leaving room for "-" + hash suffix. Strip any trailing - # hyphen left by the truncation so we don't get "foo---a1b2c". - max_prefix = DNS_LABEL_MAX - _HASH_LEN - 1 - prefix = full[:max_prefix].rstrip("-") - return f"{prefix}-{h}" - - -def replica_name(deployment_name: str, cluster_name: str) -> str: - """Derive a deterministic ModelReplica name. - - Deterministic names are needed so the deployment function knows the - LLMInferenceService name on the remote cluster for URL rewriting. - """ - return dns_name(deployment_name, cluster_name) - - -def endpoint_name(deployment_name: str, cluster_name: str) -> str: - """Derive a deterministic ModelEndpoint name. - - Modelplane composes one ModelEndpoint per ModelReplica. The name - needs to be unique per (deployment, cluster) within a namespace. - """ - return dns_name(deployment_name, cluster_name) - - -def llmis_name(deployment_name: str) -> str: - """Derive the LLMInferenceService name on the remote cluster. - - Each replica composes one LLMInferenceService on its target cluster. - The name is the deployment name, which is uniform across replicas so - the control plane HTTPRoute can rewrite to the same path on every - backend. - """ - return dns_name(deployment_name) diff --git a/lib/prometheus.py b/lib/prometheus.py deleted file mode 100644 index 09f9a6c98..000000000 --- a/lib/prometheus.py +++ /dev/null @@ -1,77 +0,0 @@ -"""Prometheus configuration for backend clusters. - -The KServe backend installs kube-prometheus-stack for autoscaling metrics. -This module provides shared configuration and a helper to compose the Helm -release. -""" - -from ..model.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 -from . import helm - -# The Prometheus service name is pinned via fullnameOverride so that KEDA -# ScaledObjects and backend operators can reference it at a known address -# regardless of the auto-generated Helm release name. -NAMESPACE = "monitoring" -FULLNAME_OVERRIDE = "prometheus" -URL = f"http://{FULLNAME_OVERRIDE}-prometheus.{NAMESPACE}.svc.cluster.local:9090" - -CHART = "kube-prometheus-stack" -REPO = "https://prometheus-community.github.io/helm-charts" - - -def helm_release(version: str, provider_config: str) -> helmv1beta1.Release: - """Build a kube-prometheus-stack Helm release for a backend cluster.""" - return helm.helm_release( - chart=CHART, - repo=REPO, - version=version, - namespace=NAMESPACE, - provider_config=provider_config, - values={ - "fullnameOverride": FULLNAME_OVERRIDE, - "prometheus": { - "prometheusSpec": { - # Discover PodMonitors across all namespaces. - "podMonitorSelectorNilUsesHelmValues": False, - "podMonitorNamespaceSelector": {}, - # Scrape Envoy Gateway proxy pods for upstream request - # metrics (envoy_cluster_upstream_rq_active). Envoy - # Gateway is used for ingress, and this metric measures - # in-flight requests at the proxy level. - "additionalScrapeConfigs": [ - { - "job_name": "envoy-gateway-proxy", - "kubernetes_sd_configs": [ - { - "role": "pod", - "namespaces": { - "names": ["envoy-gateway-system"], - }, - }, - ], - "relabel_configs": [ - { - "source_labels": [ - "__meta_kubernetes_pod_label_app_kubernetes_io_component", - ], - "action": "keep", - "regex": "proxy", - }, - { - "source_labels": ["__address__"], - "action": "replace", - "regex": "([^:]+)(?::\\d+)?", - "replacement": "$1:19001", - "target_label": "__address__", - }, - ], - "metrics_path": "/stats/prometheus", - }, - ], - }, - }, - # Disable components we don't need for autoscaling. - "grafana": {"enabled": False}, - "alertmanager": {"enabled": False}, - }, - ) diff --git a/lib/resource.py b/lib/resource.py deleted file mode 100644 index 28851cf0d..000000000 --- a/lib/resource.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Resource serialization helpers. - -TODO: Contribute model_to_dict and update_status upstream to the Crossplane -Python Function SDK. The SDK's resource.update() handles model_to_dict -internally but doesn't expose it as a standalone function. update_status -has no SDK equivalent. -""" - -import pydantic - - -def model_to_dict(model: pydantic.BaseModel) -> dict: - """Serialize a Pydantic model to a dict, preserving apiVersion and kind. - - Pydantic's model_dump(exclude_defaults=True) drops apiVersion and kind - when they equal the model's defaults. This matches the behavior of the - SDK's resource.update(), which re-adds them after dumping. - - Use this for test assertions where you want to match only the fields you - explicitly set. For test fixtures (extraResources, observedResources), - use model_to_fixture instead. - """ - data = model.model_dump(exclude_defaults=True, warnings=False) - if hasattr(model, "apiVersion"): - data["apiVersion"] = model.apiVersion - if hasattr(model, "kind"): - data["kind"] = model.kind - return data - - -def model_to_fixture(model: pydantic.BaseModel) -> dict: - """Serialize a Pydantic model to a dict for use as a test fixture. - - Unlike model_to_dict, this uses exclude_none=True so that fields with - default values (e.g. spec.backend="KServe") are preserved. This is - correct for extraResources and observedResources where the fixture - represents a fully-realized resource with defaults applied. - """ - data = model.model_dump(exclude_none=True, warnings=False) - if hasattr(model, "apiVersion"): - data["apiVersion"] = model.apiVersion - if hasattr(model, "kind"): - data["kind"] = model.kind - return data - - -def update_status(r, status: pydantic.BaseModel) -> None: - """Update a resource's status using a typed Pydantic Status model. - - Centralizes the serialization mode for status writes. Uses - exclude_none=True so every explicitly set field is emitted, even if it - equals the model default, but fields left as None are omitted. - """ - # TODO: Remove this lazy import once the up CLI's Python test runner - # (uptest-pyrunner) includes crossplane-function-sdk-python. The test - # runner only installs pydantic, so importing the SDK at module level - # crashes test manifest generation. Functions and tests share this lib - # via symlinks, so any top-level SDK import breaks tests. - from crossplane.function import resource # noqa: PLC0415 - - resource.update(r, {"status": status.model_dump(exclude_none=True)}) diff --git a/lib/secrets.py b/lib/secrets.py deleted file mode 100644 index 6b0acac1a..000000000 --- a/lib/secrets.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Secret type and key constants shared across composition functions. - -The GKECluster function writes secrets to XR status with these types. Other -functions (compose-inference-cluster, compose-kserve-backend) match on the type -string to find the right secret. Changing a type here without updating all -consumers would silently break the lookup. -""" - -# Secret types written by compose-gke-cluster, read by compose-inference-cluster -# and compose-kserve-backend. -SECRET_TYPE_KUBECONFIG = "Kubeconfig" -SECRET_TYPE_GCP_SA_KEY = "GCPServiceAccountKey" - -# Secret keys. These are the keys within the Kubernetes Secret objects -# created by the GCP providers. Used when building ProviderConfig secretRefs. -SECRET_KEY_KUBECONFIG = "kubeconfig" -SECRET_KEY_GCP_SA = "private_key" diff --git a/nix/apps.nix b/nix/apps.nix index c6ee1a1ff..107e246bd 100644 --- a/nix/apps.nix +++ b/nix/apps.nix @@ -14,6 +14,23 @@ # set to false. This ensures apps only use explicitly declared tools. { pkgs }: { + # Format Python code. + format = _: { + type = "app"; + meta.description = "Format Python code"; + program = pkgs.lib.getExe ( + pkgs.writeShellApplication { + name = "modelplane-format"; + runtimeInputs = [ pkgs.ruff ]; + inheritPath = false; + text = '' + ruff format functions/ + ruff check --fix functions/ + ''; + } + ); + }; + # Lint Python code. lint = _: { type = "app"; @@ -24,8 +41,8 @@ runtimeInputs = [ pkgs.ruff ]; inheritPath = false; text = '' - ruff format --check functions/ lib/ tests/ - ruff check functions/ lib/ tests/ + ruff format --check functions/ + ruff check functions/ ''; } ); @@ -33,7 +50,7 @@ # Build the Crossplane project (XRDs, functions, and compositions). buildCrossplane = - { up, dockerCredentialUp }: + { crossplane, dockerCredentialUp }: { type = "app"; meta.description = "Build the Crossplane project"; @@ -41,37 +58,65 @@ pkgs.writeShellApplication { name = "modelplane-build-crossplane"; runtimeInputs = [ - up + crossplane dockerCredentialUp ]; inheritPath = false; text = '' - up project build "$@" + crossplane project build "$@" ''; } ); }; - # Build the Crossplane project and run composition tests. These need Docker - # for the function-python runtime, so they can't run in the Nix sandbox. + # Run unit tests. Builds the project first to generate Pydantic models, + # then creates a venv with function dependencies and runs unittest + # across all functions. testCrossplane = - { up, dockerCredentialUp }: + { crossplane, dockerCredentialUp }: { type = "app"; - meta.description = "Build the Crossplane project and run composition tests"; + meta.description = "Build the Crossplane project and run unit tests"; program = pkgs.lib.getExe ( pkgs.writeShellApplication { name = "modelplane-test-crossplane"; runtimeInputs = [ - up + crossplane dockerCredentialUp + pkgs.python3 ]; inheritPath = false; text = '' - up project build + crossplane project build + + echo "" + echo "Setting up test environment..." + python3 -m venv .venv-test + .venv-test/bin/pip install --quiet \ + crossplane-function-sdk-python==0.11.0 \ + schemas/python + + # grpcio's C extension needs libstdc++. + export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + echo "" - echo "Running composition tests..." - up test run tests/* + echo "Running unit tests..." + failed=0 + for fn in functions/compose-*; do + echo "" + echo "--- ''${fn} ---" + if [ -d "''${fn}/tests" ]; then + (cd "$fn" && ../../.venv-test/bin/python -m unittest discover -s tests -v) || failed=1 + else + echo " (no tests)" + fi + done + + if [ "$failed" -ne 0 ]; then + echo "" + echo "FAIL: some tests failed" + exit 1 + fi ''; } ); @@ -85,7 +130,7 @@ # Pass --tag to override, e.g.: # nix run .#push-crossplane -- --tag v0.1.0 pushCrossplane = - { up, dockerCredentialUp }: + { crossplane, dockerCredentialUp }: { type = "app"; meta.description = "Push the Crossplane project to a registry"; @@ -93,7 +138,7 @@ pkgs.writeShellApplication { name = "modelplane-push-crossplane"; runtimeInputs = [ - up + crossplane dockerCredentialUp pkgs.git ]; @@ -108,7 +153,7 @@ echo "Pushing with tag: $tag" set -- --tag "$tag" "$@" fi - up project push "$@" + crossplane project push "$@" ''; } ); diff --git a/nix/build.nix b/nix/build.nix index 7037ef82d..b0df57c45 100644 --- a/nix/build.nix +++ b/nix/build.nix @@ -2,73 +2,60 @@ # # All builders are functions that take an attrset of arguments and return a # derivation. The actual build definitions live in flake.nix. -{ pkgs, ... }: +{ pkgs, crossplane-cli, ... }: let - # The up CLI isn't in nixpkgs. Fetch the binary from Upbound's CDN. - upVersion = "0.44.3"; - upBins = { - "x86_64-linux" = { - url = "https://cli.upbound.io/stable/v${upVersion}/bin/linux_amd64/up"; - hash = "sha256-tvPmftejC2Pcsjn8kYf5DfPPUYHEtK5kQlQCJfyM7uc="; - }; - "aarch64-linux" = { - url = "https://cli.upbound.io/stable/v${upVersion}/bin/linux_arm64/up"; - hash = "sha256-gnJht2k343zPNr2qpoPQtTBgeVro4fyfJWs1idzaM1M="; - }; - "x86_64-darwin" = { - # TODO(negz): Prefetch and verify this hash. - url = "https://cli.upbound.io/stable/v${upVersion}/bin/darwin_amd64/up"; - hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - }; - "aarch64-darwin" = { - url = "https://cli.upbound.io/stable/v${upVersion}/bin/darwin_arm64/up"; - hash = "sha256-Z2lbmnDxhgXDh+JN6yxIYtelQ2//Pg/HHHCgXQZBh/g="; - }; + # Map Nix system strings to the Go OS/arch pairs used in the crossplane-cli + # release bundle. + platformMap = { + "x86_64-linux" = "linux_amd64"; + "aarch64-linux" = "linux_arm64"; + "x86_64-darwin" = "darwin_amd64"; + "aarch64-darwin" = "darwin_arm64"; }; - # The Docker credential helper for xpkg.upbound.io. up shells out to it to - # authenticate when fetching package dependencies. + # The docker-credential-up binary. The Crossplane CLI uses Docker's standard + # credential chain for OCI registry auth. This helper provides credentials + # for xpkg.upbound.io. + dockerCredentialUpVersion = "0.44.3"; dockerCredentialUpBins = { "x86_64-linux" = { - url = "https://cli.upbound.io/stable/v${upVersion}/bin/linux_amd64/docker-credential-up"; + url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/linux_amd64/docker-credential-up"; hash = "sha256-weGga6mxaNqoJx1X+mgtaOlxeXSRdHBSGUjX82V8S9A="; }; "aarch64-linux" = { - url = "https://cli.upbound.io/stable/v${upVersion}/bin/linux_arm64/docker-credential-up"; + url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/linux_arm64/docker-credential-up"; hash = "sha256-3r3ZqIAKIAt/Ec9WSRbVt/rnut1k+Kx4mLNjPgTtzUc="; }; "x86_64-darwin" = { # TODO(negz): Prefetch and verify this hash. - url = "https://cli.upbound.io/stable/v${upVersion}/bin/darwin_amd64/docker-credential-up"; + url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/darwin_amd64/docker-credential-up"; hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; }; "aarch64-darwin" = { - url = "https://cli.upbound.io/stable/v${upVersion}/bin/darwin_arm64/docker-credential-up"; + url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/darwin_arm64/docker-credential-up"; hash = "sha256-mSIOSuc/nKgo0hw66gpVrZlGR0l+7ZAu16YBb/4K/GE="; }; }; in { - # The Upbound up CLI. - up = + # The Crossplane CLI. The upstream flake produces a multi-platform release + # bundle. We extract the binary for the current system. + crossplane = { system }: let - bin = upBins.${system}; + release = crossplane-cli.packages.${system}.default; + platform = platformMap.${system}; in pkgs.stdenvNoCC.mkDerivation { - pname = "up"; - version = upVersion; - src = pkgs.fetchurl { - inherit (bin) url hash; - }; + pname = "crossplane"; + version = release.version or "0.0.0"; dontUnpack = true; installPhase = '' - install -Dm755 $src $out/bin/up + install -Dm755 ${release}/bin/${platform}/crossplane $out/bin/crossplane ''; }; - # The docker-credential-up binary. Required by up to authenticate with - # xpkg.upbound.io when fetching package dependencies. + # The docker-credential-up binary for xpkg.upbound.io authentication. dockerCredentialUp = { system }: let @@ -76,7 +63,7 @@ in in pkgs.stdenvNoCC.mkDerivation { pname = "docker-credential-up"; - version = upVersion; + version = dockerCredentialUpVersion; src = pkgs.fetchurl { inherit (bin) url hash; }; @@ -85,5 +72,4 @@ in install -Dm755 $src $out/bin/docker-credential-up ''; }; - } diff --git a/nix/checks.nix b/nix/checks.nix index 5220a5c09..4b41a6d7f 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -22,9 +22,9 @@ chmod -R u+w src cd src echo "Checking Python formatting..." - ruff format --check functions/ lib/ tests/ + ruff format --check functions/ echo "Running Python linter..." - ruff check functions/ lib/ tests/ + ruff check functions/ mkdir -p $out touch $out/.python-checks-passed ''; diff --git a/pyproject.toml b/pyproject.toml index d9f956b24..81fa0385f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ -# Tool configuration for ruff and pyright. The up CLI handles building and -# packaging composition functions — this file is only for linting and +# Tool configuration for ruff and pyright. The Crossplane CLI handles building +# and packaging composition functions — this file is for linting and # type-checking. [tool.ruff] @@ -30,11 +30,13 @@ max-args = 8 [tool.ruff.lint.per-file-ignores] # Generated models are not under our control. -".up/python/models/**" = ["ALL"] +"schemas/python/**" = ["ALL"] +# Tests use magic values, many parameters, and long hardcoded resource dicts. +"**/tests/**" = ["E501", "PLR2004", "PLR0913"] +# fn.py uses gRPC's required PascalCase method name. +"functions/*/function/fn.py" = ["N802"] [tool.pyright] pythonVersion = "3.12" -# Type-check the function code and shared library. Exclude generated models -# and the tests directory (up CLI's test runner has its own structure). -include = ["functions", "lib"] -exclude = [".up"] +include = ["functions"] +exclude = ["schemas"] diff --git a/skills/crossplane-python-functions/SKILL.md b/skills/crossplane-python-functions/SKILL.md index 24bdf9363..aacb80a48 100644 --- a/skills/crossplane-python-functions/SKILL.md +++ b/skills/crossplane-python-functions/SKILL.md @@ -1,15 +1,15 @@ --- name: crossplane-python-functions -description: Write Python composition functions for Crossplane v2 using the up CLI. Use when writing, debugging, or refactoring composition functions, when working with the compose(req, rsp) pattern, when dealing with required resources, readiness tracking, resource gating, deletion ordering, or when the user mentions function-python, compose functions, or Crossplane compositions. -compatibility: Requires the up CLI and Docker with buildx. +description: Write Python composition functions for Crossplane v2 using the Crossplane CLI. Use when writing, debugging, or refactoring composition functions, when working with the compose(req, rsp) pattern, when dealing with required resources, readiness tracking, resource gating, deletion ordering, or when the user mentions function-python, compose functions, or Crossplane compositions. +compatibility: Requires the Crossplane CLI and Docker. --- # Writing Crossplane v2 Python Composition Functions ## The Function Contract -Functions are embedded Python executed by `function-python`. Each lives in -`functions/{name}/main.py` and exports one function: +Each function is a hatch-buildable Python package under `functions/{name}/`. +The composition logic lives in `function/compose.py` and exports: ```python from crossplane.function.proto.v1 import run_function_pb2 as fnv1 @@ -18,23 +18,26 @@ def compose(req: fnv1.RunFunctionRequest, rsp: fnv1.RunFunctionResponse): pass # Mutate rsp in place. Don't return anything. ``` -Do NOT use the class-based `FunctionRunner` pattern from standalone SDK docs. -Do NOT call `response.to(req)`. Do NOT return `rsp`. +Do NOT call `response.to(req)` in compose(). Do NOT return `rsp`. The +`fn.py` boilerplate handles creating the response and calling compose(). -Each function directory contains `main.py` and a `model` symlink: +Each function directory has this structure: ``` functions/my-function/ -├── main.py -└── model -> ../../.up/python/models +├── pyproject.toml # Declares deps on crossplane-models, modelplanelib, SDK +├── function/ +│ ├── __init__.py +│ ├── __version__.py +│ ├── main.py # CLI entrypoint (boilerplate) +│ ├── fn.py # FunctionRunner gRPC service (boilerplate) +│ └── compose.py # The actual composition logic ``` See [references/example.py](references/example.py) for a complete example function demonstrating all key patterns: Pydantic models, gating, readiness, events, status, deletion ordering. -The `model` symlink is required. Without it, the function crashes at runtime -with `ModuleNotFoundError: No module named 'function.model'`. Use -`up function generate` to create new functions, or create the symlink manually. +Use `crossplane function generate` to scaffold new functions. ## Build Cycle @@ -42,35 +45,29 @@ with `ModuleNotFoundError: No module named 'function.model'`. Use # 1. Write XRD (apis/myresource/definition.yaml) # 2. Write composition (apis/myresource/composition.yaml) # 3. Build to generate Pydantic models -up project build -# 4. Write the function (functions/compose-myresource/main.py) -# 5. Write test (tests/test-myresource/main.py) +crossplane project build +# 4. Write the function (functions/compose-myresource/function/compose.py) +# 5. Write test (tests/test_myresource.py) # 6. Build again, then test -up project build -up test run tests/test-myresource +crossplane project build +python3 -m pytest tests/test_myresource.py -v ``` Build before writing the function — it generates Pydantic models under -`.up/python/models/` that the function imports. +`schemas/python/models/` that the function imports. -### How the Build Works (No Docker Buildx) +### How the Build Works -`up project build` does NOT use Docker or buildx to build function images. -It pulls the `function-interpreter-python` base image from the registry, -tars the function directory (following symlinks like `model`), and appends -it as a layer using `go-containerregistry`. The result is written to the -`.uppkg` file, not to the Docker daemon. +`crossplane project build` builds each function using Docker. For Python +functions, it runs `hatch build` in a Debian container to produce a wheel, +installs it into a fresh venv, then appends that venv as a layer on top of +a distroless Python base image. The result is written to an `.xpkg` file +under `_output/`. This means: -- `up project build` always picks up code changes (it reads the filesystem - directly — no caching) -- `docker images` shows stale images from previous `up test run` or - `up project run` sessions, not the latest build -- `docker run ` inspects the stale Docker cache, not the `.uppkg` -- `up project push` reads from the `.uppkg`, not Docker - -Do NOT use `docker run` to verify build output — it shows stale images. -The build is always fresh. +- Functions are real Python packages with `pyproject.toml` and declared deps +- Third-party packages (e.g. pyyaml) can be added as dependencies +- The shared library `modelplanelib` is installed via path dependency ### Deploying Changes to a Cluster @@ -94,17 +91,25 @@ via digest comparison in the ConfigurationRevision's dependencies. ## Import Paths -Both functions and tests use the `.m.` (managed/namespaced) variants: +Pydantic models are generated under `schemas/python/models/` and installed +as the `crossplane-models` package. Import them as `models.X`: + +```python +from models.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 +from models.io.crossplane.m.kubernetes.object import v1alpha1 as k8sobjv1alpha1 +``` + +The shared library is installed as `modelplanelib`: ```python -from .model.io.upbound.m.gcp.compute.network import v1beta1 as networkv1beta1 -from .model.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 +from modelplanelib import conditions, metadata, naming +from modelplanelib import resource as libresource ``` -When in doubt, check what exists under `.up/python/models/`. +When in doubt, check what exists under `schemas/python/models/`. XR models have no `.m.` segment: ```python -from .model.example.acme.platform import v1alpha1 +from models.ai.modelplane.modeldeployment import v1alpha1 ``` ## Composing Resources diff --git a/skills/crossplane-python-functions/references/example.py b/skills/crossplane-python-functions/references/example.py index df2af627a..08fdec175 100644 --- a/skills/crossplane-python-functions/references/example.py +++ b/skills/crossplane-python-functions/references/example.py @@ -10,10 +10,10 @@ from crossplane.function import resource, response from crossplane.function.proto.v1 import run_function_pb2 as fnv1 -# Pydantic models generated by `up project build` from XRDs and provider CRDs. -from .model.ai.example.appenvironment import v1alpha1 -from .model.io.upbound.m.aws.rds.instance import v1beta1 as rdsv1beta1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 +# Pydantic models generated by `crossplane project build` from XRDs and CRDs. +from models.ai.example.appenvironment import v1alpha1 +from models.io.crossplane.m.aws.rds.instance import v1beta1 as rdsv1beta1 +from models.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 def _has_condition(req: fnv1.RunFunctionRequest, name: str, cond: str) -> bool: diff --git a/tests/test-backend-second-pass/lib b/tests/test-backend-second-pass/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-backend-second-pass/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-backend-second-pass/main.py b/tests/test-backend-second-pass/main.py deleted file mode 100644 index 1323a9a44..000000000 --- a/tests/test-backend-second-pass/main.py +++ /dev/null @@ -1,123 +0,0 @@ -from .lib import resource as libresource -from .model.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 -from .model.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 -from .model.io.crossplane.m.kubernetes.providerconfig import v1alpha1 as k8spcv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="kservebackend-second-pass", - ), - spec=compositiontest.Spec( - compositionPath="apis/kservebackends/composition.yaml", - xrPath="tests/test-backend-second-pass/xr.yaml", - xrdPath="apis/kservebackends/definition.yaml", - timeoutSeconds=120, - validate=False, - # Simulate a second reconcile where both ProviderConfigs are - # observed. This unblocks the gated Helm releases. - observedResources=[ - libresource.model_to_fixture( - k8spcv1alpha1.ProviderConfig( - metadata=metav1.ObjectMeta( - name="gpu-us-central1-kserve-cluster-59ea8", - annotations={ - "crossplane.io/composition-resource-name": "provider-config-kubernetes", - }, - ), - spec=k8spcv1alpha1.Spec( - credentials=k8spcv1alpha1.Credentials(source="Secret"), - ), - ) - ), - libresource.model_to_fixture( - helmpcv1beta1.ProviderConfig( - metadata=metav1.ObjectMeta( - name="gpu-us-central1-kserve-cluster-59ea8", - annotations={ - "crossplane.io/composition-resource-name": "provider-config-helm", - }, - ), - spec=helmpcv1beta1.Spec( - credentials=helmpcv1beta1.Credentials(source="Secret"), - ), - ) - ), - ], - assertResources=[ - # Assert cert-manager Release is composed. - libresource.model_to_dict( - helmv1beta1.Release( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "cert-manager", - }, - ), - spec=helmv1beta1.Spec( - forProvider=helmv1beta1.ForProvider( - chart=helmv1beta1.Chart( - name="cert-manager", - repository="https://charts.jetstack.io", - version="v1.17.1", - ), - namespace="cert-manager", - ), - providerConfigRef=helmv1beta1.ProviderConfigRef( - kind="ProviderConfig", - name="gpu-us-central1-kserve-cluster-59ea8", - ), - ), - ) - ), - # Assert Envoy Gateway Release is composed. - libresource.model_to_dict( - helmv1beta1.Release( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "envoy-gateway", - }, - ), - spec=helmv1beta1.Spec( - forProvider=helmv1beta1.ForProvider( - chart=helmv1beta1.Chart( - name="gateway-helm", - repository="oci://docker.io/envoyproxy", - version="v1.3.0", - ), - namespace="envoy-gateway-system", - ), - providerConfigRef=helmv1beta1.ProviderConfigRef( - kind="ProviderConfig", - name="gpu-us-central1-kserve-cluster-59ea8", - ), - ), - ) - ), - # Assert LeaderWorkerSet Release is composed. - libresource.model_to_dict( - helmv1beta1.Release( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "leader-worker-set", - }, - ), - spec=helmv1beta1.Spec( - forProvider=helmv1beta1.ForProvider( - chart=helmv1beta1.Chart( - name="lws", - repository="oci://registry.k8s.io/lws/charts", - version="v0.7.0", - ), - namespace="lws-system", - ), - providerConfigRef=helmv1beta1.ProviderConfigRef( - kind="ProviderConfig", - name="gpu-us-central1-kserve-cluster-59ea8", - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-backend-second-pass/model b/tests/test-backend-second-pass/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-backend-second-pass/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-backend-second-pass/xr.yaml b/tests/test-backend-second-pass/xr.yaml deleted file mode 100644 index 94c7412fd..000000000 --- a/tests/test-backend-second-pass/xr.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: infrastructure.modelplane.ai/v1alpha1 -kind: KServeBackend -metadata: - name: gpu-us-central1-kserve - namespace: gpu-us-central1 -spec: - secrets: - - type: Kubeconfig - name: gpu-us-central1-kubeconfig - key: kubeconfig - - type: GCPServiceAccountKey - name: gpu-us-central1-sa-key - key: private_key - versions: - kserve: "v0.16.0" - certManager: "v1.17.1" - envoyGateway: "v1.3.0" - leaderWorkerSet: "v0.7.0" - gateway: - className: envoy - listeners: - - name: http - port: 80 - protocol: HTTP diff --git a/tests/test-backend/lib b/tests/test-backend/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-backend/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-backend/main.py b/tests/test-backend/main.py deleted file mode 100644 index fb8d59884..000000000 --- a/tests/test-backend/main.py +++ /dev/null @@ -1,73 +0,0 @@ -from .lib import resource as libresource -from .model.ai.modelplane.infrastructure.kservebackend import v1alpha1 as kssv1alpha1 -from .model.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 -from .model.io.crossplane.m.kubernetes.providerconfig import v1alpha1 as k8spcv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="kservebackend-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/kservebackends/composition.yaml", - xrPath="tests/test-backend/xr.yaml", - xrdPath="apis/kservebackends/definition.yaml", - timeoutSeconds=120, - validate=False, - assertResources=[ - # Assert the XR spec is echoed back. - libresource.model_to_dict( - kssv1alpha1.KServeBackend( - metadata=metav1.ObjectMeta( - name="gpu-us-central1-kserve", - namespace="gpu-us-central1", - ), - spec=kssv1alpha1.Spec( - secrets=[ - kssv1alpha1.Secret( - type="Kubeconfig", - name="gpu-us-central1-kubeconfig", - key="kubeconfig", - ), - kssv1alpha1.Secret( - type="GCPServiceAccountKey", - name="gpu-us-central1-sa-key", - key="private_key", - ), - ], - ), - ) - ), - # Assert ProviderConfigs are composed on the first pass. - # Helm releases are gated on ProviderConfigs being observed, - # so they don't appear until the second reconcile. - libresource.model_to_dict( - k8spcv1alpha1.ProviderConfig( - metadata=metav1.ObjectMeta( - name="gpu-us-central1-kserve-cluster-59ea8", - annotations={ - "crossplane.io/composition-resource-name": "provider-config-kubernetes", - }, - ), - spec=k8spcv1alpha1.Spec( - credentials=k8spcv1alpha1.Credentials(source="Secret"), - ), - ) - ), - libresource.model_to_dict( - helmpcv1beta1.ProviderConfig( - metadata=metav1.ObjectMeta( - name="gpu-us-central1-kserve-cluster-59ea8", - annotations={ - "crossplane.io/composition-resource-name": "provider-config-helm", - }, - ), - spec=helmpcv1beta1.Spec( - credentials=helmpcv1beta1.Credentials(source="Secret"), - ), - ) - ), - ], - ), -) diff --git a/tests/test-backend/model b/tests/test-backend/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-backend/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-backend/xr.yaml b/tests/test-backend/xr.yaml deleted file mode 100644 index 94c7412fd..000000000 --- a/tests/test-backend/xr.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: infrastructure.modelplane.ai/v1alpha1 -kind: KServeBackend -metadata: - name: gpu-us-central1-kserve - namespace: gpu-us-central1 -spec: - secrets: - - type: Kubeconfig - name: gpu-us-central1-kubeconfig - key: kubeconfig - - type: GCPServiceAccountKey - name: gpu-us-central1-sa-key - key: private_key - versions: - kserve: "v0.16.0" - certManager: "v1.17.1" - envoyGateway: "v1.3.0" - leaderWorkerSet: "v0.7.0" - gateway: - className: envoy - listeners: - - name: http - port: 80 - protocol: HTTP diff --git a/tests/test-gkecluster/lib b/tests/test-gkecluster/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-gkecluster/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-gkecluster/main.py b/tests/test-gkecluster/main.py deleted file mode 100644 index 88d3cd069..000000000 --- a/tests/test-gkecluster/main.py +++ /dev/null @@ -1,236 +0,0 @@ -from .lib import resource as libresource -from .model.ai.modelplane.infrastructure.gkecluster import v1alpha1 as gkev1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest -from .model.io.upbound.m.gcp.cloudplatform.serviceaccount import v1beta1 as sav1beta1 -from .model.io.upbound.m.gcp.cloudplatform.serviceaccountkey import ( - v1beta1 as sakeyv1beta1, -) -from .model.io.upbound.m.gcp.compute.network import v1beta1 as networkv1beta1 -from .model.io.upbound.m.gcp.container.cluster import v1beta1 as clusterv1beta1 -from .model.io.upbound.m.gcp.container.nodepool import v1beta1 as nodepoolv1beta1 - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="gkecluster-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/gkeclusters/composition.yaml", - xrPath="tests/test-gkecluster/xr.yaml", - xrdPath="apis/gkeclusters/definition.yaml", - timeoutSeconds=120, - validate=False, - assertResources=[ - libresource.model_to_dict( - gkev1alpha1.GKECluster( - metadata=metav1.ObjectMeta( - name="gpu-us-central1", - namespace="gpu-us-central1", - ), - spec=gkev1alpha1.Spec( - project="acme-ml-platform", - region="us-central1", - nodePools=[ - gkev1alpha1.NodePool( - name="gpu-l4", - role="GPU", - machineType="g2-standard-4", - diskSizeGb=100, - nodeCount=1, - minNodeCount=0, - maxNodeCount=2, - gpu=gkev1alpha1.Gpu( - acceleratorType="nvidia-l4", - acceleratorCount=1, - memory="24Gi", - ), - zones=["us-central1-a", "us-central1-c"], - ), - ], - ), - status=gkev1alpha1.Status( - secrets=[ - gkev1alpha1.Secret( - type="Kubeconfig", - name="gpu-us-central1-kubeconfig-f1423", - key="kubeconfig", - ), - gkev1alpha1.Secret( - type="GCPServiceAccountKey", - name="gpu-us-central1-sa-key-ea360", - key="private_key", - ), - ], - ), - ) - ), - libresource.model_to_dict( - networkv1beta1.Network( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "network", - }, - ), - spec=networkv1beta1.Spec( - forProvider=networkv1beta1.ForProvider( - project="acme-ml-platform", - autoCreateSubnetworks=False, - ), - ), - ) - ), - libresource.model_to_dict( - clusterv1beta1.Cluster( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "cluster", - }, - ), - spec=clusterv1beta1.Spec( - forProvider=clusterv1beta1.ForProvider( - location="us-central1", - project="acme-ml-platform", - deletionProtection=False, - removeDefaultNodePool=True, - initialNodeCount=1, - minMasterVersion="1.35", - networkSelector=clusterv1beta1.NetworkSelector( - matchControllerRef=True, - ), - subnetworkSelector=clusterv1beta1.SubnetworkSelector( - matchControllerRef=True, - ), - ipAllocationPolicy=clusterv1beta1.IpAllocationPolicy( - clusterSecondaryRangeName="pods", - servicesSecondaryRangeName="services", - ), - releaseChannel=clusterv1beta1.ReleaseChannel( - channel="REGULAR", - ), - workloadIdentityConfig=clusterv1beta1.WorkloadIdentityConfig( - workloadPool="acme-ml-platform.svc.id.goog", - ), - ), - writeConnectionSecretToRef=clusterv1beta1.WriteConnectionSecretToRef( - name="gpu-us-central1-kubeconfig-f1423", - namespace="gpu-us-central1", - ), - ), - ) - ), - libresource.model_to_dict( - nodepoolv1beta1.NodePool( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "nodepool-system", - }, - ), - spec=nodepoolv1beta1.Spec( - forProvider=nodepoolv1beta1.ForProvider( - location="us-central1", - project="acme-ml-platform", - clusterSelector=nodepoolv1beta1.ClusterSelector( - matchControllerRef=True, - ), - initialNodeCount=1, - autoscaling=nodepoolv1beta1.Autoscaling( - minNodeCount=1, - maxNodeCount=2, - ), - nodeConfig=nodepoolv1beta1.NodeConfig( - machineType="e2-standard-4", - imageType="COS_CONTAINERD", - oauthScopes=[ - "https://www.googleapis.com/auth/cloud-platform", - ], - labels={ - "modelplane.ai/pool": "system", - }, - ), - ), - ), - ) - ), - libresource.model_to_dict( - nodepoolv1beta1.NodePool( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "nodepool-gpu-l4", - }, - ), - spec=nodepoolv1beta1.Spec( - forProvider=nodepoolv1beta1.ForProvider( - location="us-central1", - project="acme-ml-platform", - clusterSelector=nodepoolv1beta1.ClusterSelector( - matchControllerRef=True, - ), - initialNodeCount=1, - autoscaling=nodepoolv1beta1.Autoscaling( - minNodeCount=0, - maxNodeCount=2, - ), - nodeLocations=["us-central1-a", "us-central1-c"], - nodeConfig=nodepoolv1beta1.NodeConfig( - machineType="g2-standard-4", - diskSizeGb=100, - imageType="COS_CONTAINERD", - oauthScopes=[ - "https://www.googleapis.com/auth/cloud-platform", - ], - labels={ - "modelplane.ai/gpu": "nvidia-l4", - "modelplane.ai/pool": "gpu-l4", - }, - guestAccelerator=[ - nodepoolv1beta1.GuestAcceleratorItem( - type="nvidia-l4", - count=1, - gpuDriverInstallationConfig=nodepoolv1beta1.GpuDriverInstallationConfig( - gpuDriverVersion="DEFAULT", - ), - ), - ], - ), - ), - ), - ) - ), - libresource.model_to_dict( - sav1beta1.ServiceAccount( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "service-account", - }, - ), - spec=sav1beta1.Spec( - forProvider=sav1beta1.ForProvider( - project="acme-ml-platform", - displayName="Crossplane GKECluster gpu-us-central1", - ), - ), - ) - ), - libresource.model_to_dict( - sakeyv1beta1.ServiceAccountKey( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "service-account-key", - }, - ), - spec=sakeyv1beta1.Spec( - forProvider=sakeyv1beta1.ForProvider( - serviceAccountIdSelector=sakeyv1beta1.ServiceAccountIdSelector( - matchControllerRef=True, - ), - ), - writeConnectionSecretToRef=sakeyv1beta1.WriteConnectionSecretToRef( - name="gpu-us-central1-sa-key-ea360", - namespace="gpu-us-central1", - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-gkecluster/model b/tests/test-gkecluster/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-gkecluster/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-gkecluster/xr.yaml b/tests/test-gkecluster/xr.yaml deleted file mode 100644 index 46803fd9d..000000000 --- a/tests/test-gkecluster/xr.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: infrastructure.modelplane.ai/v1alpha1 -kind: GKECluster -metadata: - name: gpu-us-central1 - namespace: gpu-us-central1 -spec: - project: acme-ml-platform - region: us-central1 - kubernetesVersion: "1.35" - networking: - podCidr: "10.1.0.0/16" - serviceCidr: "10.2.0.0/16" - nodeCidr: "10.0.0.0/24" - nodePools: - - name: gpu-l4 - role: GPU - machineType: g2-standard-4 - diskSizeGb: 100 - nodeCount: 1 - minNodeCount: 0 - maxNodeCount: 2 - gpu: - acceleratorType: nvidia-l4 - acceleratorCount: 1 - memory: 24Gi - zones: - - us-central1-a - - us-central1-c diff --git a/tests/test-inference-cluster-existing/lib b/tests/test-inference-cluster-existing/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-inference-cluster-existing/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-inference-cluster-existing/main.py b/tests/test-inference-cluster-existing/main.py deleted file mode 100644 index 366d9bdf3..000000000 --- a/tests/test-inference-cluster-existing/main.py +++ /dev/null @@ -1,132 +0,0 @@ -from .lib import resource as libresource -from .model.ai.modelplane.inferenceclass import v1alpha1 as iclv1alpha1 -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.infrastructure.kservebackend import v1alpha1 as kssv1alpha1 -from .model.io.crossplane.m.kubernetes.clusterproviderconfig import ( - v1alpha1 as k8scpcv1alpha1, -) -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="inference-cluster-existing", - ), - spec=compositiontest.Spec( - compositionPath="apis/inferenceclusters/composition.yaml", - xrPath="tests/test-inference-cluster-existing/xr.yaml", - xrdPath="apis/inferenceclusters/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # The InferenceClass referenced by spec.nodePools[].className. No - # provisioning block - this class describes existing hardware. - libresource.model_to_fixture( - iclv1alpha1.InferenceClass( - metadata=metav1.ObjectMeta(name="h100-8x-byo"), - spec=iclv1alpha1.Spec( - resources=iclv1alpha1.Resources( - gpu=iclv1alpha1.Gpu( - count=8, - memory="80Gi", - ), - ), - ), - ) - ), - ], - # No observedResources needed - the Existing path composes - # everything on the first pass since the kubeconfig secret is - # user-supplied, not from a composed GKECluster. - assertResources=[ - # Assert the XR has status populated with providerConfigRef, - # namespace, and GPU capacity from the class. - libresource.model_to_dict( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="byo-us-east", - ), - spec=icv1alpha1.Spec( - cluster=icv1alpha1.Cluster( - source="Existing", - existing=icv1alpha1.Existing( - secretRef=icv1alpha1.SecretRef( - name="byo-cluster-kubeconfig", - key="kubeconfig", - ), - ), - ), - nodePools=[ - icv1alpha1.NodePool( - name="gpu-h100", - className="h100-8x-byo", - nodeCount=2, - ), - ], - ), - status=icv1alpha1.Status( - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="byo-us-east-cluster-kubeconfig-74ade", - ), - namespace="modelplane-system", - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="", - memory="80Gi", - nodes=2, - countPerNode=8, - ), - ], - ), - ), - ) - ), - # Assert no GKECluster is composed - cluster is user-managed. - # Assert KServeBackend is composed with the user-supplied kubeconfig. - libresource.model_to_dict( - kssv1alpha1.KServeBackend( - metadata=metav1.ObjectMeta( - name="byo-us-east-kserve-13a06", - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "kserve-backend", - }, - ), - spec=kssv1alpha1.Spec( - versions=kssv1alpha1.Versions(kserve="v0.16.0"), - secrets=[ - kssv1alpha1.Secret( - type="Kubeconfig", - name="byo-cluster-kubeconfig", - key="kubeconfig", - ), - ], - ), - ) - ), - # Assert ClusterProviderConfig references the user-supplied - # kubeconfig - no GCP identity needed. - libresource.model_to_dict( - k8scpcv1alpha1.ClusterProviderConfig( - metadata=metav1.ObjectMeta( - name="byo-us-east-cluster-kubeconfig-74ade", - annotations={ - "crossplane.io/composition-resource-name": "cluster-provider-config-kubernetes", - }, - ), - spec=k8scpcv1alpha1.Spec( - credentials=k8scpcv1alpha1.Credentials( - source="Secret", - secretRef=k8scpcv1alpha1.SecretRef( - namespace="modelplane-system", - name="byo-cluster-kubeconfig", - key="kubeconfig", - ), - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-inference-cluster-existing/model b/tests/test-inference-cluster-existing/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-inference-cluster-existing/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-inference-cluster-existing/xr.yaml b/tests/test-inference-cluster-existing/xr.yaml deleted file mode 100644 index 7099f020f..000000000 --- a/tests/test-inference-cluster-existing/xr.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: InferenceCluster -metadata: - name: byo-us-east - labels: - modelplane.ai/cluster: "true" - modelplane.ai/region: us-east -spec: - cluster: - source: Existing - existing: - secretRef: - name: byo-cluster-kubeconfig - key: kubeconfig - nodePools: - - name: gpu-h100 - className: h100-8x-byo - nodeCount: 2 diff --git a/tests/test-inference-cluster/lib b/tests/test-inference-cluster/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-inference-cluster/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-inference-cluster/main.py b/tests/test-inference-cluster/main.py deleted file mode 100644 index 4bdb389ad..000000000 --- a/tests/test-inference-cluster/main.py +++ /dev/null @@ -1,236 +0,0 @@ -from .lib import resource as libresource -from .model.ai.modelplane.inferenceclass import v1alpha1 as iclv1alpha1 -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.infrastructure.gkecluster import v1alpha1 as gkev1alpha1 -from .model.ai.modelplane.infrastructure.kservebackend import v1alpha1 as kssv1alpha1 -from .model.io.crossplane.m.kubernetes.clusterproviderconfig import ( - v1alpha1 as k8scpcv1alpha1, -) -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="inference-cluster-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/inferenceclusters/composition.yaml", - xrPath="tests/test-inference-cluster/xr.yaml", - xrdPath="apis/inferenceclusters/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # The InferenceClass referenced by spec.nodePools[].className. - libresource.model_to_fixture( - iclv1alpha1.InferenceClass( - metadata=metav1.ObjectMeta(name="gke-l4-1x-g2"), - spec=iclv1alpha1.Spec( - provisioning=iclv1alpha1.Provisioning( - provider="GKE", - gke=iclv1alpha1.Gke( - machineType="g2-standard-8", - diskSizeGb=100, - accelerator=iclv1alpha1.Accelerator( - type="nvidia-l4", - count=1, - ), - ), - ), - resources=iclv1alpha1.Resources( - gpu=iclv1alpha1.Gpu( - count=1, - memory="24Gi", - ), - ), - ), - ) - ), - ], - # Simulate a second reconcile where the GKECluster is observed and - # Ready with secrets. This triggers KServeBackend and - # ClusterProviderConfig composition. - observedResources=[ - libresource.model_to_fixture( - gkev1alpha1.GKECluster( - metadata=metav1.ObjectMeta( - name="demo-us-central", - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "gke-cluster", - }, - ), - spec=gkev1alpha1.Spec( - project="my-gcp-project", - region="us-central1", - nodePools=[ - gkev1alpha1.NodePool( - name="system", - role="System", - machineType="e2-standard-4", - ), - ], - ), - status=gkev1alpha1.Status( - conditions=[ - gkev1alpha1.Condition( - type="Ready", - status="True", - reason="Available", - lastTransitionTime="2025-01-01T00:00:00Z", - ) - ], - secrets=[ - gkev1alpha1.Secret( - type="Kubeconfig", - name="demo-us-central-kubeconfig-edfc0", - key="kubeconfig", - ), - gkev1alpha1.Secret( - type="GCPServiceAccountKey", - name="demo-us-central-sa-key-77d51", - key="credentials.json", - ), - ], - ), - ) - ), - ], - assertResources=[ - # Assert the XR has status populated with providerConfigRef, - # namespace, and GPU capacity derived from the class. - libresource.model_to_dict( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="demo-us-central", - ), - spec=icv1alpha1.Spec( - cluster=icv1alpha1.Cluster( - source="GKE", - gke=icv1alpha1.Gke( - project="my-gcp-project", - region="us-central1", - ), - ), - nodePools=[ - icv1alpha1.NodePool( - name="gpu-l4", - className="gke-l4-1x-g2", - maxNodeCount=2, - zones=["us-central1-a", "us-central1-c"], - ), - ], - ), - status=icv1alpha1.Status( - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="demo-us-central-cluster-kubeconfig-65bed", - ), - namespace="modelplane-system", - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-l4", - memory="24Gi", - nodes=2, - countPerNode=1, - ), - ], - ), - ), - ) - ), - # Assert GKECluster is composed with the GPU pool derived from - # the InferenceClass. The system pool is injected by - # compose-gke-cluster, not compose-inference-cluster. - libresource.model_to_dict( - gkev1alpha1.GKECluster( - metadata=metav1.ObjectMeta( - name="demo-us-central", - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "gke-cluster", - }, - ), - spec=gkev1alpha1.Spec( - project="my-gcp-project", - region="us-central1", - nodePools=[ - gkev1alpha1.NodePool( - name="gpu-l4", - role="GPU", - machineType="g2-standard-8", - diskSizeGb=100, - nodeCount=1, - minNodeCount=0, - maxNodeCount=2, - gpu=gkev1alpha1.Gpu( - acceleratorType="nvidia-l4", - acceleratorCount=1, - memory="24Gi", - ), - zones=["us-central1-a", "us-central1-c"], - ), - ], - ), - ) - ), - # Assert KServeBackend is composed (gated on GKE being ready). - libresource.model_to_dict( - kssv1alpha1.KServeBackend( - metadata=metav1.ObjectMeta( - name="demo-us-central-kserve-1b3ff", - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "kserve-backend", - }, - ), - spec=kssv1alpha1.Spec( - versions=kssv1alpha1.Versions(kserve="v0.16.0"), - secrets=[ - kssv1alpha1.Secret( - type="Kubeconfig", - name="demo-us-central-kubeconfig-edfc0", - key="kubeconfig", - ), - kssv1alpha1.Secret( - type="GCPServiceAccountKey", - name="demo-us-central-sa-key-77d51", - key="credentials.json", - ), - ], - ), - ) - ), - # Assert ClusterProviderConfig is composed for cross-namespace - # Object creation by ModelReplicas. - libresource.model_to_dict( - k8scpcv1alpha1.ClusterProviderConfig( - metadata=metav1.ObjectMeta( - name="demo-us-central-cluster-kubeconfig-65bed", - annotations={ - "crossplane.io/composition-resource-name": "cluster-provider-config-kubernetes", - }, - ), - spec=k8scpcv1alpha1.Spec( - credentials=k8scpcv1alpha1.Credentials( - source="Secret", - secretRef=k8scpcv1alpha1.SecretRef( - namespace="modelplane-system", - name="demo-us-central-kubeconfig-edfc0", - key="kubeconfig", - ), - ), - identity=k8scpcv1alpha1.Identity( - type="GoogleApplicationCredentials", - source="Secret", - secretRef=k8scpcv1alpha1.SecretRef( - namespace="modelplane-system", - name="demo-us-central-sa-key-77d51", - key="credentials.json", - ), - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-inference-cluster/model b/tests/test-inference-cluster/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-inference-cluster/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-inference-cluster/xr.yaml b/tests/test-inference-cluster/xr.yaml deleted file mode 100644 index f49cf9167..000000000 --- a/tests/test-inference-cluster/xr.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: InferenceCluster -metadata: - name: demo-us-central - labels: - modelplane.ai/cluster: "true" - modelplane.ai/region: us-central -spec: - cluster: - source: GKE - gke: - project: my-gcp-project - region: us-central1 - nodePools: - - name: gpu-l4 - className: gke-l4-1x-g2 - nodeCount: 1 - minNodeCount: 0 - maxNodeCount: 2 - zones: - - us-central1-a - - us-central1-c diff --git a/tests/test-inference-gateway-second-pass/lib b/tests/test-inference-gateway-second-pass/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-inference-gateway-second-pass/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-inference-gateway-second-pass/main.py b/tests/test-inference-gateway-second-pass/main.py deleted file mode 100644 index 072adacae..000000000 --- a/tests/test-inference-gateway-second-pass/main.py +++ /dev/null @@ -1,96 +0,0 @@ -from .lib import resource as libresource -from .model.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 -from .model.io.crossplane.m.helm.release import v1beta1 as helmv1beta1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="inference-gateway-second-pass", - ), - spec=compositiontest.Spec( - compositionPath="apis/inferencegateways/composition.yaml", - xrPath="tests/test-inference-gateway-second-pass/xr.yaml", - xrdPath="apis/inferencegateways/definition.yaml", - timeoutSeconds=120, - validate=False, - # Simulate a second reconcile where the Helm ProviderConfig is - # observed. This unblocks the gated Helm releases. - observedResources=[ - libresource.model_to_fixture( - helmpcv1beta1.ProviderConfig( - metadata=metav1.ObjectMeta( - name="modelplane-in-cluster", - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "provider-config-helm", - }, - ), - spec=helmpcv1beta1.Spec( - credentials=helmpcv1beta1.Credentials( - source="InjectedIdentity", - ), - ), - ) - ), - ], - assertResources=[ - # Assert MetalLB Release is composed. - libresource.model_to_dict( - helmv1beta1.Release( - metadata=metav1.ObjectMeta( - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "metallb", - }, - labels={ - "modelplane.ai/release": "metallb", - }, - ), - spec=helmv1beta1.Spec( - forProvider=helmv1beta1.ForProvider( - chart=helmv1beta1.Chart( - name="metallb", - repository="https://metallb.github.io/metallb", - version="0.14.9", - ), - namespace="metallb-system", - ), - providerConfigRef=helmv1beta1.ProviderConfigRef( - kind="ProviderConfig", - name="modelplane-in-cluster", - ), - ), - ) - ), - # Assert Envoy Gateway Release is composed. - libresource.model_to_dict( - helmv1beta1.Release( - metadata=metav1.ObjectMeta( - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "envoy-gateway", - }, - labels={ - "modelplane.ai/release": "envoy-gateway", - }, - ), - spec=helmv1beta1.Spec( - forProvider=helmv1beta1.ForProvider( - chart=helmv1beta1.Chart( - name="gateway-helm", - repository="oci://docker.io/envoyproxy", - version="v1.3.0", - ), - namespace="envoy-gateway-system", - ), - providerConfigRef=helmv1beta1.ProviderConfigRef( - kind="ProviderConfig", - name="modelplane-in-cluster", - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-inference-gateway-second-pass/model b/tests/test-inference-gateway-second-pass/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-inference-gateway-second-pass/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-inference-gateway-second-pass/xr.yaml b/tests/test-inference-gateway-second-pass/xr.yaml deleted file mode 100644 index 153a988be..000000000 --- a/tests/test-inference-gateway-second-pass/xr.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: InferenceGateway -metadata: - name: default -spec: - backend: EnvoyGateway - envoyGateway: - version: v1.3.0 - loadBalancer: MetalLB - metallb: - addressPool: "172.18.255.200-172.18.255.250" - gateway: - port: 80 diff --git a/tests/test-inference-gateway/lib b/tests/test-inference-gateway/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-inference-gateway/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-inference-gateway/main.py b/tests/test-inference-gateway/main.py deleted file mode 100644 index fed271e73..000000000 --- a/tests/test-inference-gateway/main.py +++ /dev/null @@ -1,46 +0,0 @@ -from .lib import resource as libresource -from .model.ai.modelplane.inferencegateway import v1alpha1 as igwv1alpha1 -from .model.io.crossplane.m.helm.providerconfig import v1beta1 as helmpcv1beta1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="inference-gateway-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/inferencegateways/composition.yaml", - xrPath="tests/test-inference-gateway/xr.yaml", - xrdPath="apis/inferencegateways/definition.yaml", - timeoutSeconds=120, - validate=False, - assertResources=[ - # Assert the XR exists. No status.address on the first pass - # (the Gateway hasn't been assigned an IP yet). - libresource.model_to_dict( - igwv1alpha1.InferenceGateway( - metadata=metav1.ObjectMeta(name="default"), - spec=igwv1alpha1.Spec(backend="EnvoyGateway"), - ) - ), - # Assert the Helm ProviderConfig is composed in - # modelplane-system. - libresource.model_to_dict( - helmpcv1beta1.ProviderConfig( - metadata=metav1.ObjectMeta( - name="modelplane-in-cluster", - namespace="modelplane-system", - annotations={ - "crossplane.io/composition-resource-name": "provider-config-helm", - }, - ), - spec=helmpcv1beta1.Spec( - credentials=helmpcv1beta1.Credentials( - source="InjectedIdentity", - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-inference-gateway/model b/tests/test-inference-gateway/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-inference-gateway/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-inference-gateway/xr.yaml b/tests/test-inference-gateway/xr.yaml deleted file mode 100644 index 153a988be..000000000 --- a/tests/test-inference-gateway/xr.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: InferenceGateway -metadata: - name: default -spec: - backend: EnvoyGateway - envoyGateway: - version: v1.3.0 - loadBalancer: MetalLB - metallb: - addressPool: "172.18.255.200-172.18.255.250" - gateway: - port: 80 diff --git a/tests/test-model-deployment-incompatible-cluster/lib b/tests/test-model-deployment-incompatible-cluster/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-deployment-incompatible-cluster/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-deployment-incompatible-cluster/main.py b/tests/test-model-deployment-incompatible-cluster/main.py deleted file mode 100644 index 30179eff2..000000000 --- a/tests/test-model-deployment-incompatible-cluster/main.py +++ /dev/null @@ -1,140 +0,0 @@ -"""Test that clusterSelector filters out clusters with mismatched labels. - -The deployment requires modelplane.ai/region: us-central. Two clusters -are present: one with the matching label, one without. Only the -compatible cluster should get a replica. -""" - -from datetime import UTC, datetime - -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modeldeployment import v1alpha1 as mdv1alpha1 -from .model.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-deployment-incompatible-cluster", - ), - spec=compositiontest.Spec( - compositionPath="apis/modeldeployments/composition.yaml", - xrPath="tests/test-model-deployment-incompatible-cluster/xr.yaml", - xrdPath="apis/modeldeployments/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # Compatible: labels match the deployment's clusterSelector. - # The incompatible cluster (without the region label) would - # be filtered out by Crossplane before reaching the function, - # so we only fixture the compatible one. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="compatible-cluster", - labels={ - "modelplane.ai/cluster": "true", - "modelplane.ai/region": "us-central", - }, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="Existing")), - status=icv1alpha1.Status( - conditions=[ - icv1alpha1.Condition( - type="Ready", - status="True", - reason="Available", - lastTransitionTime=datetime(2025, 1, 1, tzinfo=UTC), - ), - ], - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="compatible-cluster-kubeconfig", - ), - gateway=icv1alpha1.Gateway(address="10.0.0.1"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-l4", - countPerNode=1, - nodes=2, - memory="24Gi", - ) - ], - ), - ), - ) - ), - ], - assertResources=[ - # Assert only the compatible cluster gets a replica. - libresource.model_to_dict( - mrv1alpha1.ModelReplica( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "replica-compatible-cluster", - }, - name="qwen-demo-compatible-cluster-bdaf4", - namespace="ml-team", - labels={ - "modelplane.ai/replica": "true", - "modelplane.ai/deployment": "qwen-demo", - "modelplane.ai/cluster": "compatible-cluster", - }, - ), - spec=mrv1alpha1.SpecModel( - inferenceClusterRef=mrv1alpha1.InferenceClusterRef( - name="compatible-cluster", - ), - workers=mrv1alpha1.Workers( - topology=mrv1alpha1.Topology(tensor=1), - template=mrv1alpha1.Template( - spec=mrv1alpha1.Spec( - containers=[ - mrv1alpha1.Container( - name="engine", - image="vllm/vllm-openai:v0.7.3", - args=["--model=Qwen/Qwen2.5-0.5B-Instruct"], - ), - ], - ), - ), - ), - ), - ) - ), - # Assert the XR status shows 1 replica. - libresource.model_to_dict( - mdv1alpha1.ModelDeployment( - metadata=metav1.ObjectMeta( - name="qwen-demo", - namespace="ml-team", - ), - spec=mdv1alpha1.SpecModel( - replicas=1, - clusterSelector=mdv1alpha1.ClusterSelector( - matchLabels={"modelplane.ai/region": "us-central"}, - ), - workers=mdv1alpha1.Workers( - topology=mdv1alpha1.Topology(tensor=1), - template=mdv1alpha1.Template( - spec=mdv1alpha1.Spec( - containers=[ - mdv1alpha1.Container( - name="engine", - image="vllm/vllm-openai:v0.7.3", - args=["--model=Qwen/Qwen2.5-0.5B-Instruct"], - ), - ], - ), - ), - ), - ), - status=mdv1alpha1.Status( - replicas=mdv1alpha1.Replicas(total=1, ready=0), - ), - ) - ), - ], - ), -) diff --git a/tests/test-model-deployment-incompatible-cluster/model b/tests/test-model-deployment-incompatible-cluster/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-deployment-incompatible-cluster/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-deployment-incompatible-cluster/xr.yaml b/tests/test-model-deployment-incompatible-cluster/xr.yaml deleted file mode 100644 index 2f8227f07..000000000 --- a/tests/test-model-deployment-incompatible-cluster/xr.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelDeployment -metadata: - name: qwen-demo - namespace: ml-team -spec: - replicas: 1 - clusterSelector: - matchLabels: - modelplane.ai/region: us-central - workers: - topology: - tensor: 1 - template: - spec: - containers: - - name: engine - image: vllm/vllm-openai:v0.7.3 - args: - - "--model=Qwen/Qwen2.5-0.5B-Instruct" diff --git a/tests/test-model-deployment-insufficient-nodes/lib b/tests/test-model-deployment-insufficient-nodes/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-deployment-insufficient-nodes/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-deployment-insufficient-nodes/main.py b/tests/test-model-deployment-insufficient-nodes/main.py deleted file mode 100644 index d7ffa10fe..000000000 --- a/tests/test-model-deployment-insufficient-nodes/main.py +++ /dev/null @@ -1,96 +0,0 @@ -"""Test that the scheduler rejects clusters with insufficient nodes. - -The deployment uses tensor=8, pipeline=2 topology, meaning each replica -needs 2 nodes with 8 GPUs each. The cluster only has 1 -node. The scheduler should produce 0 replicas. -""" - -from datetime import UTC, datetime - -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modeldeployment import v1alpha1 as mdv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-deployment-insufficient-nodes", - ), - spec=compositiontest.Spec( - compositionPath="apis/modeldeployments/composition.yaml", - xrPath="tests/test-model-deployment-insufficient-nodes/xr.yaml", - xrdPath="apis/modeldeployments/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # 1-node H100 cluster: 8 GPUs per node. The replica's topology - # asks for pipeline=2, which requires 2 nodes. Only 1 is - # available, so no replica should be scheduled. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="small-h100", - labels={"modelplane.ai/cluster": "true"}, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="Existing")), - status=icv1alpha1.Status( - conditions=[ - icv1alpha1.Condition( - type="Ready", - status="True", - reason="Available", - lastTransitionTime=datetime(2025, 1, 1, tzinfo=UTC), - ), - ], - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="small-h100-cluster", - ), - gateway=icv1alpha1.Gateway(address="10.0.0.1"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-h100-80gb", - countPerNode=8, - nodes=1, - memory="80Gi", - ) - ], - ), - ), - ) - ), - ], - assertResources=[ - # Assert no replicas - the topology doesn't fit. - libresource.model_to_dict( - mdv1alpha1.ModelDeployment( - metadata=metav1.ObjectMeta( - name="llama405b-demo", - namespace="ml-team", - ), - spec=mdv1alpha1.SpecModel( - replicas=1, - workers=mdv1alpha1.Workers( - topology=mdv1alpha1.Topology(tensor=8, pipeline=2), - template=mdv1alpha1.Template( - spec=mdv1alpha1.Spec( - containers=[ - mdv1alpha1.Container( - name="engine", - image="vllm/vllm-openai:v0.7.3", - args=["--model=meta-llama/Llama-3.1-405B"], - ), - ], - ), - ), - ), - ), - status=mdv1alpha1.Status( - replicas=mdv1alpha1.Replicas(total=0, ready=0), - ), - ) - ), - ], - ), -) diff --git a/tests/test-model-deployment-insufficient-nodes/model b/tests/test-model-deployment-insufficient-nodes/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-deployment-insufficient-nodes/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-deployment-insufficient-nodes/xr.yaml b/tests/test-model-deployment-insufficient-nodes/xr.yaml deleted file mode 100644 index 5538b783e..000000000 --- a/tests/test-model-deployment-insufficient-nodes/xr.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelDeployment -metadata: - name: llama405b-demo - namespace: ml-team -spec: - replicas: 1 - workers: - topology: - tensor: 8 - pipeline: 2 - template: - spec: - containers: - - name: engine - image: vllm/vllm-openai:v0.7.3 - args: - - "--model=meta-llama/Llama-3.1-405B" diff --git a/tests/test-model-deployment-not-ready/lib b/tests/test-model-deployment-not-ready/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-deployment-not-ready/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-deployment-not-ready/main.py b/tests/test-model-deployment-not-ready/main.py deleted file mode 100644 index e26325347..000000000 --- a/tests/test-model-deployment-not-ready/main.py +++ /dev/null @@ -1,94 +0,0 @@ -"""Test that the scheduler skips clusters that aren't Ready. - -The cluster has matching labels and sufficient GPU capacity, but its -Ready condition is False. The scheduler should not schedule to it. -""" - -from datetime import UTC, datetime - -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modeldeployment import v1alpha1 as mdv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-deployment-not-ready", - ), - spec=compositiontest.Spec( - compositionPath="apis/modeldeployments/composition.yaml", - xrPath="tests/test-model-deployment-not-ready/xr.yaml", - xrdPath="apis/modeldeployments/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # A cluster with capacity but Ready=False. The scheduler - # should skip it entirely. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="not-ready-cluster", - labels={"modelplane.ai/cluster": "true"}, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="GKE")), - status=icv1alpha1.Status( - conditions=[ - icv1alpha1.Condition( - type="Ready", - status="False", - reason="BackendNotReady", - lastTransitionTime=datetime(2025, 1, 1, tzinfo=UTC), - ), - ], - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="not-ready-cluster-config", - ), - gateway=icv1alpha1.Gateway(address="10.0.0.1"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-l4", - countPerNode=1, - nodes=2, - memory="24Gi", - ) - ], - ), - ), - ) - ), - ], - assertResources=[ - # Assert no replicas scheduled. - libresource.model_to_dict( - mdv1alpha1.ModelDeployment( - metadata=metav1.ObjectMeta( - name="qwen-demo", - namespace="ml-team", - ), - spec=mdv1alpha1.SpecModel( - replicas=1, - workers=mdv1alpha1.Workers( - topology=mdv1alpha1.Topology(tensor=1), - template=mdv1alpha1.Template( - spec=mdv1alpha1.Spec( - containers=[ - mdv1alpha1.Container( - name="engine", - image="vllm/vllm-openai:v0.7.3", - args=["--model=Qwen/Qwen2.5-0.5B-Instruct"], - ), - ], - ), - ), - ), - ), - status=mdv1alpha1.Status( - replicas=mdv1alpha1.Replicas(total=0, ready=0), - ), - ) - ), - ], - ), -) diff --git a/tests/test-model-deployment-not-ready/model b/tests/test-model-deployment-not-ready/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-deployment-not-ready/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-deployment-not-ready/xr.yaml b/tests/test-model-deployment-not-ready/xr.yaml deleted file mode 100644 index 8fbb1bb7c..000000000 --- a/tests/test-model-deployment-not-ready/xr.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelDeployment -metadata: - name: qwen-demo - namespace: ml-team -spec: - replicas: 1 - workers: - topology: - tensor: 1 - template: - spec: - containers: - - name: engine - image: vllm/vllm-openai:v0.7.3 - args: - - "--model=Qwen/Qwen2.5-0.5B-Instruct" diff --git a/tests/test-model-deployment-stable-scheduling/lib b/tests/test-model-deployment-stable-scheduling/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-deployment-stable-scheduling/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-deployment-stable-scheduling/main.py b/tests/test-model-deployment-stable-scheduling/main.py deleted file mode 100644 index 8ad810023..000000000 --- a/tests/test-model-deployment-stable-scheduling/main.py +++ /dev/null @@ -1,179 +0,0 @@ -"""Test that scheduling is stable. - -Two compatible clusters exist; cluster-b already has a replica from a -previous reconcile. With replicas=1, the scheduler should keep cluster-b -rather than rescheduling to cluster-a (which sorts first alphabetically). -""" - -from datetime import UTC, datetime - -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -REPLICA_SPEC = mrv1alpha1.SpecModel( - inferenceClusterRef=mrv1alpha1.InferenceClusterRef( - name="cluster-b", - ), - workers=mrv1alpha1.Workers( - topology=mrv1alpha1.Topology(tensor=1), - template=mrv1alpha1.Template( - spec=mrv1alpha1.Spec( - containers=[ - mrv1alpha1.Container( - name="engine", - image="vllm/vllm-openai:v0.7.3", - args=["--model=Qwen/Qwen2.5-0.5B-Instruct"], - ), - ], - ), - ), - ), -) - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-deployment-stable-scheduling", - ), - spec=compositiontest.Spec( - compositionPath="apis/modeldeployments/composition.yaml", - xrPath="tests/test-model-deployment-stable-scheduling/xr.yaml", - xrdPath="apis/modeldeployments/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # cluster-a: a new cluster that just came online. Sorts first - # lexicographically, so without the stability sort it would - # displace cluster-b's existing replica. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="cluster-a", - labels={"modelplane.ai/cluster": "true"}, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="Existing")), - status=icv1alpha1.Status( - conditions=[ - icv1alpha1.Condition( - type="Ready", - status="True", - reason="Available", - lastTransitionTime=datetime(2025, 1, 1, tzinfo=UTC), - ), - ], - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="cluster-a-cluster", - ), - gateway=icv1alpha1.Gateway(address="10.0.0.1"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-l4", - countPerNode=1, - nodes=2, - memory="24Gi", - ) - ], - ), - ), - ) - ), - # cluster-b: already has a replica (simulated via observedResources). - # With replicas=1 the scheduler should prefer cluster-b because - # it already has an observed replica - even though cluster-a - # sorts first lexicographically. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="cluster-b", - labels={"modelplane.ai/cluster": "true"}, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="Existing")), - status=icv1alpha1.Status( - conditions=[ - icv1alpha1.Condition( - type="Ready", - status="True", - reason="Available", - lastTransitionTime=datetime(2025, 1, 1, tzinfo=UTC), - ), - ], - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="cluster-b-cluster", - ), - gateway=icv1alpha1.Gateway(address="10.0.0.2"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-l4", - countPerNode=1, - nodes=2, - memory="24Gi", - ) - ], - ), - ), - ) - ), - # The existing replica on cluster-b, also visible as a required - # resource so the scheduler knows cluster-b already has a replica. - libresource.model_to_fixture( - mrv1alpha1.ModelReplica( - metadata=metav1.ObjectMeta( - name="qwen-demo-cluster-b-1ea0d", - namespace="ml-team", - labels={ - "modelplane.ai/replica": "true", - "modelplane.ai/deployment": "qwen-demo", - "modelplane.ai/cluster": "cluster-b", - }, - ), - spec=REPLICA_SPEC, - ) - ), - ], - # Simulate a second reconcile where replica-cluster-b already exists. - # The scheduler should keep cluster-b, not reschedule to cluster-a. - observedResources=[ - libresource.model_to_dict( - mrv1alpha1.ModelReplica( - metadata=metav1.ObjectMeta( - name="qwen-demo-cluster-b-1ea0d", - namespace="ml-team", - annotations={ - "crossplane.io/composition-resource-name": "replica-cluster-b", - }, - labels={ - "modelplane.ai/replica": "true", - "modelplane.ai/deployment": "qwen-demo", - "modelplane.ai/cluster": "cluster-b", - }, - ), - spec=REPLICA_SPEC, - ) - ), - ], - assertResources=[ - # Assert the replica stays on cluster-b, not rescheduled to cluster-a. - libresource.model_to_dict( - mrv1alpha1.ModelReplica( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "replica-cluster-b", - }, - name="qwen-demo-cluster-b-1ea0d", - namespace="ml-team", - labels={ - "modelplane.ai/replica": "true", - "modelplane.ai/deployment": "qwen-demo", - "modelplane.ai/cluster": "cluster-b", - }, - ), - spec=REPLICA_SPEC, - ) - ), - ], - ), -) diff --git a/tests/test-model-deployment-stable-scheduling/model b/tests/test-model-deployment-stable-scheduling/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-deployment-stable-scheduling/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-deployment-stable-scheduling/xr.yaml b/tests/test-model-deployment-stable-scheduling/xr.yaml deleted file mode 100644 index 8fbb1bb7c..000000000 --- a/tests/test-model-deployment-stable-scheduling/xr.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelDeployment -metadata: - name: qwen-demo - namespace: ml-team -spec: - replicas: 1 - workers: - topology: - tensor: 1 - template: - spec: - containers: - - name: engine - image: vllm/vllm-openai:v0.7.3 - args: - - "--model=Qwen/Qwen2.5-0.5B-Instruct" diff --git a/tests/test-model-deployment/lib b/tests/test-model-deployment/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-deployment/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-deployment/main.py b/tests/test-model-deployment/main.py deleted file mode 100644 index cc208c18f..000000000 --- a/tests/test-model-deployment/main.py +++ /dev/null @@ -1,148 +0,0 @@ -from datetime import UTC, datetime - -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.ai.modelplane.modeldeployment import v1alpha1 as mdv1alpha1 -from .model.ai.modelplane.modelendpoint import v1alpha1 as mev1alpha1 -from .model.ai.modelplane.modelreplica import v1alpha1 as mrv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-deployment-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/modeldeployments/composition.yaml", - xrPath="tests/test-model-deployment/xr.yaml", - xrdPath="apis/modeldeployments/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # A ready InferenceCluster with KServe backend and one L4 pool. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="demo-us-central", - labels={"modelplane.ai/cluster": "true"}, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="Existing")), - status=icv1alpha1.Status( - conditions=[ - icv1alpha1.Condition( - type="Ready", - status="True", - reason="Available", - lastTransitionTime=datetime(2025, 1, 1, tzinfo=UTC), - ), - ], - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="demo-us-central-cluster", - ), - gateway=icv1alpha1.Gateway(address="34.55.100.10"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-l4", - countPerNode=1, - nodes=2, - memory="24Gi", - ) - ], - ), - ), - ) - ), - ], - assertResources=[ - # Assert the XR has status populated with the replica count. - libresource.model_to_dict( - mdv1alpha1.ModelDeployment( - metadata=metav1.ObjectMeta( - name="qwen-demo", - namespace="ml-team", - ), - spec=mdv1alpha1.SpecModel( - replicas=1, - workers=mdv1alpha1.Workers( - topology=mdv1alpha1.Topology(tensor=1), - template=mdv1alpha1.Template( - spec=mdv1alpha1.Spec( - containers=[ - mdv1alpha1.Container( - name="engine", - image="vllm/vllm-openai:v0.7.3", - args=["--model=Qwen/Qwen2.5-0.5B-Instruct"], - ), - ], - ), - ), - ), - ), - status=mdv1alpha1.Status( - replicas=mdv1alpha1.Replicas( - total=1, - ready=0, - ), - ), - ) - ), - # Assert a ModelReplica is composed for the matched cluster. - libresource.model_to_dict( - mrv1alpha1.ModelReplica( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "replica-demo-us-central", - }, - name="qwen-demo-demo-us-central-7078d", - namespace="ml-team", - labels={ - "modelplane.ai/replica": "true", - "modelplane.ai/deployment": "qwen-demo", - "modelplane.ai/cluster": "demo-us-central", - }, - ), - spec=mrv1alpha1.SpecModel( - inferenceClusterRef=mrv1alpha1.InferenceClusterRef( - name="demo-us-central", - ), - workers=mrv1alpha1.Workers( - topology=mrv1alpha1.Topology(tensor=1), - template=mrv1alpha1.Template( - spec=mrv1alpha1.Spec( - containers=[ - mrv1alpha1.Container( - name="engine", - image="vllm/vllm-openai:v0.7.3", - args=["--model=Qwen/Qwen2.5-0.5B-Instruct"], - ), - ], - ), - ), - ), - ), - ) - ), - # Assert a ModelEndpoint is composed for the matched cluster. - libresource.model_to_dict( - mev1alpha1.ModelEndpoint( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "endpoint-demo-us-central", - }, - name="qwen-demo-demo-us-central-7078d", - namespace="ml-team", - labels={ - "modelplane.ai/deployment": "qwen-demo", - "modelplane.ai/cluster": "demo-us-central", - }, - ), - spec=mev1alpha1.Spec( - url="http://34.55.100.10/default/qwen-demo-86093/v1", - rewritePath="/default/qwen-demo-86093/", - ), - ) - ), - ], - ), -) diff --git a/tests/test-model-deployment/model b/tests/test-model-deployment/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-deployment/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-deployment/xr.yaml b/tests/test-model-deployment/xr.yaml deleted file mode 100644 index 8fbb1bb7c..000000000 --- a/tests/test-model-deployment/xr.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelDeployment -metadata: - name: qwen-demo - namespace: ml-team -spec: - replicas: 1 - workers: - topology: - tensor: 1 - template: - spec: - containers: - - name: engine - image: vllm/vllm-openai:v0.7.3 - args: - - "--model=Qwen/Qwen2.5-0.5B-Instruct" diff --git a/tests/test-model-endpoint/lib b/tests/test-model-endpoint/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-endpoint/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-endpoint/main.py b/tests/test-model-endpoint/main.py deleted file mode 100644 index 9ce3524bd..000000000 --- a/tests/test-model-endpoint/main.py +++ /dev/null @@ -1,36 +0,0 @@ -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-endpoint-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/modelendpoints/composition.yaml", - xrPath="tests/test-model-endpoint/xr.yaml", - xrdPath="apis/modelendpoints/definition.yaml", - timeoutSeconds=120, - validate=False, - assertResources=[ - # Assert an Envoy Gateway Backend is composed on the control - # plane pointing at the host:port parsed from spec.url. - { - "apiVersion": "gateway.envoyproxy.io/v1alpha1", - "kind": "Backend", - "metadata": { - "namespace": "ml-team", - "annotations": { - "crossplane.io/composition-resource-name": "backend", - }, - }, - "spec": { - "endpoints": [ - { - "ip": {"address": "34.55.100.10", "port": 80}, - } - ], - }, - }, - ], - ), -) diff --git a/tests/test-model-endpoint/model b/tests/test-model-endpoint/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-endpoint/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-endpoint/xr.yaml b/tests/test-model-endpoint/xr.yaml deleted file mode 100644 index ba923a299..000000000 --- a/tests/test-model-endpoint/xr.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelEndpoint -metadata: - name: qwen-demo-demo-us-central - namespace: ml-team - labels: - modelplane.ai/deployment: qwen-demo -spec: - url: http://34.55.100.10/default/qwen-demo/v1 - rewritePath: /default/qwen-demo/ diff --git a/tests/test-model-replica-multinode/lib b/tests/test-model-replica-multinode/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-replica-multinode/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-replica-multinode/main.py b/tests/test-model-replica-multinode/main.py deleted file mode 100644 index 12787ba23..000000000 --- a/tests/test-model-replica-multinode/main.py +++ /dev/null @@ -1,119 +0,0 @@ -"""Test multi-node KServe replica. - -A replica with tensor=8, pipeline=2, count=2 should compose an -LLMInferenceService with: - -- replicas = 2 (from workers.count) -- 8 GPUs per pod (tensor) -- parallelism.tensor = 8, parallelism.pipeline = 2 -- worker PodSpec matching the leader template -""" - -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.io.crossplane.m.kubernetes.object import v1alpha1 as k8sobjv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -# The container shape is the same for the leader and each worker. -CONTAINER = { - "name": "main", - "image": "vllm/vllm-openai:v0.7.3", - "args": [], - "securityContext": { - "runAsUser": 0, - "runAsNonRoot": False, - }, - "resources": { - "limits": { - "nvidia.com/gpu": "8", - }, - }, -} - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-replica-kserve-multinode", - ), - spec=compositiontest.Spec( - compositionPath="apis/modelreplicas/composition.yaml", - xrPath="tests/test-model-replica-multinode/xr.yaml", - xrdPath="apis/modelreplicas/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # 3-node H100 cluster: 8 GPUs per node = 24 total. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="h100-cluster", - labels={"modelplane.ai/cluster": "true"}, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="Existing")), - status=icv1alpha1.Status( - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="h100-cluster-kubeconfig", - ), - gateway=icv1alpha1.Gateway(address="10.0.0.1"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-h100-80gb", - nodes=3, - countPerNode=8, - memory="80Gi", - ) - ], - ), - ), - ) - ), - ], - assertResources=[ - # Assert LLMInferenceService has multi-node configuration: - # - replicas = 2 (workers.count) - # - parallelism.tensor = 8, parallelism.pipeline = 2 - # - worker PodSpec matches the leader template - libresource.model_to_dict( - k8sobjv1alpha1.Object( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "model-serving", - }, - ), - spec=k8sobjv1alpha1.Spec( - providerConfigRef=k8sobjv1alpha1.ProviderConfigRef( - kind="ClusterProviderConfig", - name="h100-cluster-kubeconfig", - ), - readiness=k8sobjv1alpha1.Readiness( - policy="DeriveFromObject", - ), - forProvider=k8sobjv1alpha1.ForProvider( - manifest={ - "apiVersion": "serving.kserve.io/v1alpha1", - "kind": "LLMInferenceService", - "metadata": { - "name": "llama405b-ef974", - "namespace": "default", - }, - "spec": { - "model": {"uri": "hf://meta-llama/Llama-3.1-405B"}, - "replicas": 2, - "parallelism": {"tensor": 8, "pipeline": 2}, - "template": { - "containers": [CONTAINER], - }, - "worker": { - "containers": [CONTAINER], - }, - "router": {"gateway": {}, "route": {}}, - }, - }, - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-model-replica-multinode/model b/tests/test-model-replica-multinode/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-replica-multinode/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-replica-multinode/xr.yaml b/tests/test-model-replica-multinode/xr.yaml deleted file mode 100644 index 19e667b45..000000000 --- a/tests/test-model-replica-multinode/xr.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelReplica -metadata: - name: llama405b-h100-cluster - namespace: ml-team - labels: - modelplane.ai/deployment: llama405b -spec: - inferenceClusterRef: - name: h100-cluster - workers: - count: 2 - topology: - tensor: 8 - pipeline: 2 - template: - spec: - containers: - - name: engine - image: vllm/vllm-openai:v0.7.3 - args: - - "--model=meta-llama/Llama-3.1-405B" diff --git a/tests/test-model-replica/lib b/tests/test-model-replica/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-replica/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-replica/main.py b/tests/test-model-replica/main.py deleted file mode 100644 index 29dabb460..000000000 --- a/tests/test-model-replica/main.py +++ /dev/null @@ -1,105 +0,0 @@ -from .lib import resource as libresource -from .model.ai.modelplane.inferencecluster import v1alpha1 as icv1alpha1 -from .model.io.crossplane.m.kubernetes.object import v1alpha1 as k8sobjv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-replica-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/modelreplicas/composition.yaml", - xrPath="tests/test-model-replica/xr.yaml", - xrdPath="apis/modelreplicas/definition.yaml", - timeoutSeconds=120, - validate=False, - # extraResources is the up CLI's name for required resources. - # These are resources the function reads but doesn't own, resolved - # by Crossplane at runtime via response.require_resources(). - extraResources=[ - # The InferenceCluster referenced by spec.inferenceClusterRef. - # Status fields are populated as if the cluster is fully ready. - libresource.model_to_fixture( - icv1alpha1.InferenceCluster( - metadata=metav1.ObjectMeta( - name="demo-us-central", - labels={"modelplane.ai/cluster": "true"}, - ), - spec=icv1alpha1.Spec(cluster=icv1alpha1.Cluster(source="Existing")), - status=icv1alpha1.Status( - providerConfigRef=icv1alpha1.ProviderConfigRef( - name="demo-us-central-cluster", - ), - gateway=icv1alpha1.Gateway(address="34.55.100.10"), - capacity=icv1alpha1.Capacity( - gpuPools=[ - icv1alpha1.GpuPool( - acceleratorType="nvidia-l4", - countPerNode=1, - nodes=2, - memory="24Gi", - ) - ], - ), - ), - ) - ), - ], - assertResources=[ - # Assert the LLMInferenceService Object is composed on the remote - # cluster with the correct vLLM container spec and GPU count. - libresource.model_to_dict( - k8sobjv1alpha1.Object( - metadata=metav1.ObjectMeta( - annotations={ - "crossplane.io/composition-resource-name": "model-serving", - }, - ), - spec=k8sobjv1alpha1.Spec( - providerConfigRef=k8sobjv1alpha1.ProviderConfigRef( - kind="ClusterProviderConfig", - name="demo-us-central-cluster", - ), - readiness=k8sobjv1alpha1.Readiness( - policy="DeriveFromObject", - ), - forProvider=k8sobjv1alpha1.ForProvider( - manifest={ - "apiVersion": "serving.kserve.io/v1alpha1", - "kind": "LLMInferenceService", - "metadata": { - "name": "qwen-demo-86093", - "namespace": "default", - }, - "spec": { - "model": {"uri": "hf://Qwen/Qwen2.5-0.5B-Instruct"}, - "replicas": 1, - "template": { - "containers": [ - { - "name": "main", - "image": "vllm/vllm-openai:v0.7.3", - "args": [], - "securityContext": { - "runAsUser": 0, - "runAsNonRoot": False, - }, - "resources": { - "limits": { - "nvidia.com/gpu": "1", - }, - }, - } - ], - }, - "router": {"gateway": {}, "route": {}}, - }, - }, - ), - ), - ) - ), - ], - ), -) diff --git a/tests/test-model-replica/model b/tests/test-model-replica/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-replica/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-replica/xr.yaml b/tests/test-model-replica/xr.yaml deleted file mode 100644 index 1da845ea4..000000000 --- a/tests/test-model-replica/xr.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelReplica -metadata: - name: qwen-demo-demo-us-central - namespace: ml-team - labels: - modelplane.ai/deployment: qwen-demo -spec: - inferenceClusterRef: - name: demo-us-central - workers: - topology: - tensor: 1 - template: - spec: - containers: - - name: engine - image: vllm/vllm-openai:v0.7.3 - args: - - "--model=Qwen/Qwen2.5-0.5B-Instruct" diff --git a/tests/test-model-service/lib b/tests/test-model-service/lib deleted file mode 120000 index 58677ddb4..000000000 --- a/tests/test-model-service/lib +++ /dev/null @@ -1 +0,0 @@ -../../lib \ No newline at end of file diff --git a/tests/test-model-service/main.py b/tests/test-model-service/main.py deleted file mode 100644 index 29a7432ea..000000000 --- a/tests/test-model-service/main.py +++ /dev/null @@ -1,126 +0,0 @@ -from .lib import resource as libresource -from .model.ai.modelplane.inferencegateway import v1alpha1 as igwv1alpha1 -from .model.ai.modelplane.modelendpoint import v1alpha1 as mev1alpha1 -from .model.ai.modelplane.modelservice import v1alpha1 as msv1alpha1 -from .model.io.k8s.apimachinery.pkg.apis.meta import v1 as metav1 -from .model.io.upbound.dev.meta.compositiontest import v1alpha1 as compositiontest - -test = compositiontest.CompositionTest( - metadata=metav1.ObjectMeta( - name="model-service-basic", - ), - spec=compositiontest.Spec( - compositionPath="apis/modelservices/composition.yaml", - xrPath="tests/test-model-service/xr.yaml", - xrdPath="apis/modelservices/definition.yaml", - timeoutSeconds=120, - validate=False, - extraResources=[ - # The InferenceGateway for the public address and HTTPRoute - # parentRef. - libresource.model_to_fixture( - igwv1alpha1.InferenceGateway( - metadata=metav1.ObjectMeta(name="default"), - spec=igwv1alpha1.Spec(backend="EnvoyGateway"), - status=igwv1alpha1.Status(address="10.0.0.1"), - ) - ), - # One ModelEndpoint matching the selector, with its Backend - # already composed (status.routing.backendName populated). - libresource.model_to_fixture( - mev1alpha1.ModelEndpoint( - metadata=metav1.ObjectMeta( - name="qwen-demo-demo-us-central", - namespace="ml-team", - labels={"modelplane.ai/deployment": "qwen-demo"}, - ), - spec=mev1alpha1.Spec( - url="http://34.55.100.10/default/qwen-demo/v1", - rewritePath="/default/qwen-demo/", - ), - status=mev1alpha1.Status( - routing=mev1alpha1.Routing( - backendName="qwen-demo-demo-us-central-backend-x7k2", - ), - ), - ) - ), - ], - assertResources=[ - # Assert the XR exposes the public address. - libresource.model_to_dict( - msv1alpha1.ModelService( - metadata=metav1.ObjectMeta( - name="qwen", - namespace="ml-team", - ), - spec=msv1alpha1.Spec( - endpoints=[ - msv1alpha1.Endpoint( - selector=msv1alpha1.Selector( - matchLabels={"modelplane.ai/deployment": "qwen-demo"}, - ), - ), - ], - ), - status=msv1alpha1.Status( - address="http://10.0.0.1/ml-team/qwen", - ), - ) - ), - # Assert the HTTPRoute is composed with the matched endpoint's - # backend as a backendRef. The URLRewrite filter is per-backendRef - # so endpoints with different rewritePaths are rewritten correctly. - { - "apiVersion": "gateway.networking.k8s.io/v1", - "kind": "HTTPRoute", - "metadata": { - "namespace": "ml-team", - "annotations": { - "crossplane.io/composition-resource-name": "httproute", - }, - }, - "spec": { - "parentRefs": [ - { - "name": "modelplane", - "namespace": "modelplane-system", - } - ], - "rules": [ - { - "matches": [ - { - "path": { - "type": "PathPrefix", - "value": "/ml-team/qwen/", - }, - } - ], - "backendRefs": [ - { - "group": "gateway.envoyproxy.io", - "kind": "Backend", - "name": "qwen-demo-demo-us-central-backend-x7k2", - "port": 80, - "weight": 1, - "filters": [ - { - "type": "URLRewrite", - "urlRewrite": { - "path": { - "type": "ReplacePrefixMatch", - "replacePrefixMatch": "/default/qwen-demo/", - }, - }, - } - ], - } - ], - } - ], - }, - }, - ], - ), -) diff --git a/tests/test-model-service/model b/tests/test-model-service/model deleted file mode 120000 index 6ff11914c..000000000 --- a/tests/test-model-service/model +++ /dev/null @@ -1 +0,0 @@ -../../.up/python/models \ No newline at end of file diff --git a/tests/test-model-service/xr.yaml b/tests/test-model-service/xr.yaml deleted file mode 100644 index e354b2c14..000000000 --- a/tests/test-model-service/xr.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: modelplane.ai/v1alpha1 -kind: ModelService -metadata: - name: qwen - namespace: ml-team -spec: - endpoints: - - selector: - matchLabels: - modelplane.ai/deployment: qwen-demo diff --git a/upbound.yaml b/upbound.yaml deleted file mode 100644 index c6cfaf8cf..000000000 --- a/upbound.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: meta.dev.upbound.io/v2alpha1 -kind: Project -metadata: - name: modelplane -spec: - apiDependencies: - - git: - path: cluster/crds - ref: release-2.2 - repository: https://github.com/crossplane/crossplane - type: crd - dependsOn: - - apiVersion: pkg.crossplane.io/v1 - kind: Provider - package: xpkg.upbound.io/upbound/provider-gcp-container - version: v2.5.0 - - apiVersion: pkg.crossplane.io/v1 - kind: Provider - package: xpkg.upbound.io/upbound/provider-gcp-compute - version: v2.5.0 - - apiVersion: pkg.crossplane.io/v1 - kind: Provider - package: xpkg.upbound.io/upbound/provider-gcp-cloudplatform - version: v2.5.0 - - apiVersion: pkg.crossplane.io/v1 - kind: Provider - package: xpkg.upbound.io/upbound/provider-helm - version: '>=v1.2.0' - - apiVersion: pkg.crossplane.io/v1 - kind: Provider - package: xpkg.upbound.io/upbound/provider-kubernetes - version: '>=v1.2.0' - - apiVersion: pkg.crossplane.io/v1 - kind: Function - package: xpkg.upbound.io/crossplane-contrib/function-auto-ready - version: '>=v0.0.0' - description: This is where you can describe your project. - license: Apache-2.0 - maintainer: Upbound User - readme: | - This is where you can add a readme for your project. - repository: xpkg.upbound.io/modelplane/modelplane - source: github.com/modelplaneai/modelplane From ab861a3100e25fd044cc787247d97903f2c35e8b Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Thu, 21 May 2026 12:06:03 -0700 Subject: [PATCH 2/9] Add real metadata to function pyproject.toml files Every function's pyproject.toml had the same template name ("function") and description ("A Crossplane composition function."). This makes it hard to tell functions apart in tooling output, error messages, and dependency trees. This commit gives each function a distinct name matching its directory and a description summarizing what it composes. Signed-off-by: Nic Cope --- functions/compose-gke-cluster/pyproject.toml | 4 ++-- functions/compose-inference-class/pyproject.toml | 4 ++-- functions/compose-inference-cluster/pyproject.toml | 4 ++-- functions/compose-inference-gateway/pyproject.toml | 4 ++-- functions/compose-kserve-backend/pyproject.toml | 4 ++-- functions/compose-model-deployment/pyproject.toml | 4 ++-- functions/compose-model-endpoint/pyproject.toml | 4 ++-- functions/compose-model-replica/pyproject.toml | 4 ++-- functions/compose-model-service/pyproject.toml | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/functions/compose-gke-cluster/pyproject.toml b/functions/compose-gke-cluster/pyproject.toml index 9ebe5f167..14df34560 100644 --- a/functions/compose-gke-cluster/pyproject.toml +++ b/functions/compose-gke-cluster/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-gke-cluster" +description = "Compose a GKE cluster with networking, node pools, and service accounts." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-inference-class/pyproject.toml b/functions/compose-inference-class/pyproject.toml index 9ebe5f167..44a08d3c9 100644 --- a/functions/compose-inference-class/pyproject.toml +++ b/functions/compose-inference-class/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-inference-class" +description = "Mark an InferenceClass as ready." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-inference-cluster/pyproject.toml b/functions/compose-inference-cluster/pyproject.toml index 9ebe5f167..52e5822b6 100644 --- a/functions/compose-inference-cluster/pyproject.toml +++ b/functions/compose-inference-cluster/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-inference-cluster" +description = "Compose an InferenceCluster from a cluster source and KServe backend." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-inference-gateway/pyproject.toml b/functions/compose-inference-gateway/pyproject.toml index 9ebe5f167..d88b3d154 100644 --- a/functions/compose-inference-gateway/pyproject.toml +++ b/functions/compose-inference-gateway/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-inference-gateway" +description = "Compose the control plane routing gateway with Envoy Gateway and MetalLB." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-kserve-backend/pyproject.toml b/functions/compose-kserve-backend/pyproject.toml index 9ebe5f167..b28571f4d 100644 --- a/functions/compose-kserve-backend/pyproject.toml +++ b/functions/compose-kserve-backend/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-kserve-backend" +description = "Install KServe and supporting components on a remote cluster." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-model-deployment/pyproject.toml b/functions/compose-model-deployment/pyproject.toml index 9ebe5f167..dd1683293 100644 --- a/functions/compose-model-deployment/pyproject.toml +++ b/functions/compose-model-deployment/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-model-deployment" +description = "Fan out a ModelDeployment to ModelReplicas and ModelEndpoints." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-model-endpoint/pyproject.toml b/functions/compose-model-endpoint/pyproject.toml index 9ebe5f167..5d585706a 100644 --- a/functions/compose-model-endpoint/pyproject.toml +++ b/functions/compose-model-endpoint/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-model-endpoint" +description = "Compose an Envoy Gateway Backend from a ModelEndpoint." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-model-replica/pyproject.toml b/functions/compose-model-replica/pyproject.toml index 9ebe5f167..8fb4f073c 100644 --- a/functions/compose-model-replica/pyproject.toml +++ b/functions/compose-model-replica/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-model-replica" +description = "Deploy a model on a single InferenceCluster via KServe." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ diff --git a/functions/compose-model-service/pyproject.toml b/functions/compose-model-service/pyproject.toml index 9ebe5f167..60fc04ef6 100644 --- a/functions/compose-model-service/pyproject.toml +++ b/functions/compose-model-service/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "function" -description = "A Crossplane composition function." +name = "compose-model-service" +description = "Compose a Gateway API HTTPRoute from a ModelService." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ From 3d683cd28786b1b9411a7eae0ae0a74627250997 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Thu, 21 May 2026 20:23:25 -0700 Subject: [PATCH 3/9] Commit generated Python schemas instead of regenerating them The schemas/python tree is generated from XRDs by the Crossplane CLI's Python builder. Until now we relied on `crossplane project build` to produce it, which meant nothing else could rely on the schemas being present. This commit tracks the generated schemas in git and re-includes schemas/python/ in .gitignore. The schemas become a normal Python package other tooling can depend on without first running the CLI. CI can type-check the composition functions against their imported models, and a Nix-based function image builder can take schemas/python as a build input. The schemas should be regenerated whenever an XRD changes. Signed-off-by: Nic Cope --- .gitignore | 3 +- schemas/python/models/__init__.py | 0 schemas/python/models/ai/__init__.py | 0 .../python/models/ai/modelplane/__init__.py | 0 .../ai/modelplane/inferenceclass/__init__.py | 0 .../ai/modelplane/inferenceclass/v1alpha1.py | 148 + .../modelplane/inferencecluster/__init__.py | 0 .../modelplane/inferencecluster/v1alpha1.py | 208 + .../modelplane/inferencegateway/__init__.py | 0 .../modelplane/inferencegateway/v1alpha1.py | 141 + .../ai/modelplane/infrastructure/__init__.py | 0 .../infrastructure/gkecluster/__init__.py | 0 .../infrastructure/gkecluster/v1alpha1.py | 221 + .../infrastructure/kservebackend/__init__.py | 0 .../infrastructure/kservebackend/v1alpha1.py | 200 + .../ai/modelplane/modeldeployment/__init__.py | 0 .../ai/modelplane/modeldeployment/v1alpha1.py | 222 + .../ai/modelplane/modelendpoint/__init__.py | 0 .../ai/modelplane/modelendpoint/v1alpha1.py | 120 + .../ai/modelplane/modelreplica/__init__.py | 0 .../ai/modelplane/modelreplica/v1alpha1.py | 170 + .../ai/modelplane/modelservice/__init__.py | 0 .../ai/modelplane/modelservice/v1alpha1.py | 117 + schemas/python/models/io/__init__.py | 0 .../python/models/io/crossplane/__init__.py | 0 .../io/crossplane/apiextensions/__init__.py | 0 .../compositeresourcedefinition/__init__.py | 0 .../compositeresourcedefinition/v1.py | 555 ++ .../compositeresourcedefinition/v2.py | 558 ++ .../apiextensions/composition/__init__.py | 0 .../apiextensions/composition/v1.py | 213 + .../compositionrevision/__init__.py | 0 .../apiextensions/compositionrevision/v1.py | 267 + .../environmentconfig/__init__.py | 0 .../environmentconfig/v1beta1.py | 51 + .../__init__.py | 0 .../v1alpha1.py | 108 + .../managedresourcedefinition/__init__.py | 0 .../managedresourcedefinition/v1alpha1.py | 434 ++ .../apiextensions/usage/__init__.py | 0 .../apiextensions/usage/v1alpha1.py | 174 + .../crossplane/apiextensions/usage/v1beta1.py | 174 + .../models/io/crossplane/helm/__init__.py | 0 .../helm/providerconfig/__init__.py | 0 .../helm/providerconfig/v1alpha1.py | 189 + .../crossplane/helm/providerconfig/v1beta1.py | 195 + .../helm/providerconfigusage/__init__.py | 0 .../helm/providerconfigusage/v1alpha1.py | 101 + .../helm/providerconfigusage/v1beta1.py | 101 + .../io/crossplane/helm/release/__init__.py | 0 .../io/crossplane/helm/release/v1alpha1.py | 296 ++ .../io/crossplane/helm/release/v1beta1.py | 389 ++ .../io/crossplane/kubernetes/__init__.py | 0 .../crossplane/kubernetes/object/__init__.py | 0 .../crossplane/kubernetes/object/v1alpha1.py | 348 ++ .../crossplane/kubernetes/object/v1alpha2.py | 345 ++ .../observedobjectcollection/__init__.py | 0 .../observedobjectcollection/v1alpha1.py | 224 + .../kubernetes/providerconfig/__init__.py | 0 .../kubernetes/providerconfig/v1alpha1.py | 195 + .../providerconfigusage/__init__.py | 0 .../providerconfigusage/v1alpha1.py | 101 + .../python/models/io/crossplane/m/__init__.py | 0 .../models/io/crossplane/m/helm/__init__.py | 0 .../m/helm/clusterproviderconfig/__init__.py | 0 .../m/helm/clusterproviderconfig/v1beta1.py | 195 + .../m/helm/providerconfig/__init__.py | 0 .../m/helm/providerconfig/v1beta1.py | 195 + .../m/helm/providerconfigusage/__init__.py | 0 .../m/helm/providerconfigusage/v1beta1.py | 84 + .../io/crossplane/m/helm/release/__init__.py | 0 .../io/crossplane/m/helm/release/v1beta1.py | 351 ++ .../io/crossplane/m/kubernetes/__init__.py | 0 .../clusterproviderconfig/__init__.py | 0 .../clusterproviderconfig/v1alpha1.py | 195 + .../m/kubernetes/object/__init__.py | 0 .../m/kubernetes/object/v1alpha1.py | 312 ++ .../observedobjectcollection/__init__.py | 0 .../observedobjectcollection/v1alpha1.py | 209 + .../m/kubernetes/providerconfig/__init__.py | 0 .../m/kubernetes/providerconfig/v1alpha1.py | 195 + .../providerconfigusage/__init__.py | 0 .../providerconfigusage/v1alpha1.py | 84 + .../models/io/crossplane/ops/__init__.py | 0 .../crossplane/ops/cronoperation/__init__.py | 0 .../crossplane/ops/cronoperation/v1alpha1.py | 296 ++ .../io/crossplane/ops/operation/__init__.py | 0 .../io/crossplane/ops/operation/v1alpha1.py | 279 + .../crossplane/ops/watchoperation/__init__.py | 0 .../crossplane/ops/watchoperation/v1alpha1.py | 318 ++ .../models/io/crossplane/pkg/__init__.py | 0 .../crossplane/pkg/configuration/__init__.py | 0 .../io/crossplane/pkg/configuration/v1.py | 192 + .../pkg/configurationrevision/__init__.py | 0 .../pkg/configurationrevision/v1.py | 208 + .../pkg/deploymentruntimeconfig/__init__.py | 0 .../pkg/deploymentruntimeconfig/v1beta1.py | 4735 +++++++++++++++++ .../io/crossplane/pkg/function/__init__.py | 0 .../models/io/crossplane/pkg/function/v1.py | 213 + .../io/crossplane/pkg/function/v1beta1.py | 215 + .../pkg/functionrevision/__init__.py | 0 .../io/crossplane/pkg/functionrevision/v1.py | 255 + .../pkg/functionrevision/v1beta1.py | 257 + .../io/crossplane/pkg/imageconfig/__init__.py | 0 .../io/crossplane/pkg/imageconfig/v1beta1.py | 252 + .../models/io/crossplane/pkg/lock/__init__.py | 0 .../models/io/crossplane/pkg/lock/v1beta1.py | 151 + .../io/crossplane/pkg/provider/__init__.py | 0 .../models/io/crossplane/pkg/provider/v1.py | 214 + .../pkg/providerrevision/__init__.py | 0 .../io/crossplane/pkg/providerrevision/v1.py | 250 + .../io/crossplane/protection/__init__.py | 0 .../protection/clusterusage/__init__.py | 0 .../protection/clusterusage/v1beta1.py | 174 + .../crossplane/protection/usage/__init__.py | 0 .../io/crossplane/protection/usage/v1beta1.py | 202 + schemas/python/models/io/k8s/__init__.py | 0 .../models/io/k8s/apimachinery/__init__.py | 0 .../io/k8s/apimachinery/pkg/__init__.py | 0 .../io/k8s/apimachinery/pkg/apis/__init__.py | 0 .../apimachinery/pkg/apis/meta/__init__.py | 0 .../io/k8s/apimachinery/pkg/apis/meta/v1.py | 305 ++ schemas/python/models/io/upbound/__init__.py | 0 .../python/models/io/upbound/gcp/__init__.py | 0 .../io/upbound/gcp/cloudplatform/__init__.py | 0 .../gcp/cloudplatform/folder/__init__.py | 0 .../gcp/cloudplatform/folder/v1beta1.py | 321 ++ .../cloudplatform/folderiammember/__init__.py | 0 .../cloudplatform/folderiammember/v1beta1.py | 269 + .../cloudplatform/folderiammember/v1beta2.py | 269 + .../organizationiamauditconfig/__init__.py | 0 .../organizationiamauditconfig/v1beta1.py | 222 + .../organizationiamcustomrole/__init__.py | 0 .../organizationiamcustomrole/v1beta1.py | 296 ++ .../organizationiammember/__init__.py | 0 .../organizationiammember/v1beta1.py | 226 + .../organizationiammember/v1beta2.py | 226 + .../gcp/cloudplatform/project/__init__.py | 0 .../gcp/cloudplatform/project/v1beta1.py | 430 ++ .../projectdefaultserviceaccounts/__init__.py | 0 .../projectdefaultserviceaccounts/v1beta1.py | 304 ++ .../projectiamauditconfig/__init__.py | 0 .../projectiamauditconfig/v1beta1.py | 265 + .../projectiamcustomrole/__init__.py | 0 .../projectiamcustomrole/v1beta1.py | 287 + .../projectiammember/__init__.py | 0 .../cloudplatform/projectiammember/v1beta1.py | 269 + .../cloudplatform/projectiammember/v1beta2.py | 269 + .../cloudplatform/projectservice/__init__.py | 0 .../cloudplatform/projectservice/v1beta1.py | 319 ++ .../projectusageexportbucket/__init__.py | 0 .../projectusageexportbucket/v1beta1.py | 329 ++ .../cloudplatform/serviceaccount/__init__.py | 0 .../cloudplatform/serviceaccount/v1beta1.py | 300 ++ .../serviceaccountiammember/__init__.py | 0 .../serviceaccountiammember/v1beta1.py | 269 + .../serviceaccountiammember/v1beta2.py | 269 + .../serviceaccountkey/__init__.py | 0 .../serviceaccountkey/v1beta1.py | 366 ++ .../__init__.py | 0 .../v1beta1.py | 256 + .../models/io/upbound/gcp/compute/__init__.py | 0 .../upbound/gcp/compute/address/__init__.py | 0 .../io/upbound/gcp/compute/address/v1beta1.py | 530 ++ .../gcp/compute/attacheddisk/__init__.py | 0 .../gcp/compute/attacheddisk/v1beta1.py | 413 ++ .../gcp/compute/autoscaler/__init__.py | 0 .../upbound/gcp/compute/autoscaler/v1beta1.py | 535 ++ .../upbound/gcp/compute/autoscaler/v1beta2.py | 535 ++ .../gcp/compute/backendbucket/__init__.py | 0 .../gcp/compute/backendbucket/v1beta1.py | 525 ++ .../gcp/compute/backendbucket/v1beta2.py | 528 ++ .../backendbucketsignedurlkey/__init__.py | 0 .../backendbucketsignedurlkey/v1beta1.py | 319 ++ .../gcp/compute/backendservice/__init__.py | 0 .../gcp/compute/backendservice/v1beta1.py | 1865 +++++++ .../gcp/compute/backendservice/v1beta2.py | 1913 +++++++ .../backendservicesignedurlkey/__init__.py | 0 .../backendservicesignedurlkey/v1beta1.py | 319 ++ .../io/upbound/gcp/compute/disk/__init__.py | 0 .../io/upbound/gcp/compute/disk/v1beta1.py | 1022 ++++ .../io/upbound/gcp/compute/disk/v1beta2.py | 1019 ++++ .../gcp/compute/diskiammember/__init__.py | 0 .../gcp/compute/diskiammember/v1beta1.py | 275 + .../gcp/compute/diskiammember/v1beta2.py | 275 + .../diskresourcepolicyattachment/__init__.py | 0 .../diskresourcepolicyattachment/v1beta1.py | 352 ++ .../compute/externalvpngateway/__init__.py | 0 .../gcp/compute/externalvpngateway/v1beta1.py | 324 ++ .../upbound/gcp/compute/firewall/__init__.py | 0 .../upbound/gcp/compute/firewall/v1beta1.py | 703 +++ .../upbound/gcp/compute/firewall/v1beta2.py | 703 +++ .../gcp/compute/firewallpolicy/__init__.py | 0 .../gcp/compute/firewallpolicy/v1beta1.py | 280 + .../firewallpolicyassociation/__init__.py | 0 .../firewallpolicyassociation/v1beta1.py | 348 ++ .../compute/firewallpolicyrule/__init__.py | 0 .../gcp/compute/firewallpolicyrule/v1beta1.py | 570 ++ .../gcp/compute/firewallpolicyrule/v1beta2.py | 706 +++ .../gcp/compute/forwardingrule/__init__.py | 0 .../gcp/compute/forwardingrule/v1beta1.py | 1029 ++++ .../gcp/compute/forwardingrule/v1beta2.py | 1038 ++++ .../gcp/compute/globaladdress/__init__.py | 0 .../gcp/compute/globaladdress/v1beta1.py | 413 ++ .../compute/globalforwardingrule/__init__.py | 0 .../compute/globalforwardingrule/v1beta1.py | 956 ++++ .../compute/globalforwardingrule/v1beta2.py | 956 ++++ .../compute/globalnetworkendpoint/__init__.py | 0 .../compute/globalnetworkendpoint/v1beta1.py | 323 ++ .../globalnetworkendpointgroup/__init__.py | 0 .../globalnetworkendpointgroup/v1beta1.py | 274 + .../gcp/compute/havpngateway/__init__.py | 0 .../gcp/compute/havpngateway/v1beta1.py | 462 ++ .../gcp/compute/healthcheck/__init__.py | 0 .../gcp/compute/healthcheck/v1beta1.py | 681 +++ .../gcp/compute/healthcheck/v1beta2.py | 681 +++ .../gcp/compute/httphealthcheck/__init__.py | 0 .../gcp/compute/httphealthcheck/v1beta1.py | 359 ++ .../gcp/compute/httpshealthcheck/__init__.py | 0 .../gcp/compute/httpshealthcheck/v1beta1.py | 359 ++ .../io/upbound/gcp/compute/image/__init__.py | 0 .../io/upbound/gcp/compute/image/v1beta1.py | 886 +++ .../io/upbound/gcp/compute/image/v1beta2.py | 878 +++ .../gcp/compute/imageiammember/__init__.py | 0 .../gcp/compute/imageiammember/v1beta1.py | 272 + .../gcp/compute/imageiammember/v1beta2.py | 272 + .../upbound/gcp/compute/instance/__init__.py | 0 .../upbound/gcp/compute/instance/v1beta1.py | 1922 +++++++ .../upbound/gcp/compute/instance/v1beta2.py | 1920 +++++++ .../compute/instancefromtemplate/__init__.py | 0 .../compute/instancefromtemplate/v1beta1.py | 865 +++ .../compute/instancefromtemplate/v1beta2.py | 865 +++ .../gcp/compute/instancegroup/__init__.py | 0 .../gcp/compute/instancegroup/v1beta1.py | 404 ++ .../compute/instancegroupmanager/__init__.py | 0 .../compute/instancegroupmanager/v1beta1.py | 961 ++++ .../compute/instancegroupmanager/v1beta2.py | 962 ++++ .../instancegroupnamedport/__init__.py | 0 .../compute/instancegroupnamedport/v1beta1.py | 276 + .../gcp/compute/instanceiammember/__init__.py | 0 .../gcp/compute/instanceiammember/v1beta1.py | 275 + .../gcp/compute/instanceiammember/v1beta2.py | 275 + .../gcp/compute/instancetemplate/__init__.py | 0 .../gcp/compute/instancetemplate/v1beta1.py | 1600 ++++++ .../gcp/compute/instancetemplate/v1beta2.py | 1598 ++++++ .../interconnectattachment/__init__.py | 0 .../compute/interconnectattachment/v1beta1.py | 740 +++ .../compute/managedsslcertificate/__init__.py | 0 .../compute/managedsslcertificate/v1beta1.py | 304 ++ .../compute/managedsslcertificate/v1beta2.py | 304 ++ .../upbound/gcp/compute/network/__init__.py | 0 .../io/upbound/gcp/compute/network/v1beta1.py | 492 ++ .../gcp/compute/networkendpoint/__init__.py | 0 .../gcp/compute/networkendpoint/v1beta1.py | 389 ++ .../compute/networkendpointgroup/__init__.py | 0 .../compute/networkendpointgroup/v1beta1.py | 427 ++ .../compute/networkfirewallpolicy/__init__.py | 0 .../compute/networkfirewallpolicy/v1beta1.py | 261 + .../__init__.py | 0 .../v1beta1.py | 329 ++ .../networkfirewallpolicyrule/__init__.py | 0 .../networkfirewallpolicyrule/v1beta1.py | 690 +++ .../gcp/compute/networkpeering/__init__.py | 0 .../gcp/compute/networkpeering/v1beta1.py | 380 ++ .../networkpeeringroutesconfig/__init__.py | 0 .../networkpeeringroutesconfig/v1beta1.py | 395 ++ .../upbound/gcp/compute/nodegroup/__init__.py | 0 .../upbound/gcp/compute/nodegroup/v1beta1.py | 516 ++ .../upbound/gcp/compute/nodegroup/v1beta2.py | 516 ++ .../gcp/compute/nodetemplate/__init__.py | 0 .../gcp/compute/nodetemplate/v1beta1.py | 454 ++ .../gcp/compute/nodetemplate/v1beta2.py | 454 ++ .../gcp/compute/packetmirroring/__init__.py | 0 .../gcp/compute/packetmirroring/v1beta1.py | 475 ++ .../gcp/compute/packetmirroring/v1beta2.py | 475 ++ .../gcp/compute/perinstanceconfig/__init__.py | 0 .../gcp/compute/perinstanceconfig/v1beta1.py | 581 ++ .../gcp/compute/perinstanceconfig/v1beta2.py | 581 ++ .../projectdefaultnetworktier/__init__.py | 0 .../projectdefaultnetworktier/v1beta1.py | 240 + .../gcp/compute/projectmetadata/__init__.py | 0 .../gcp/compute/projectmetadata/v1beta1.py | 237 + .../compute/projectmetadataitem/__init__.py | 0 .../compute/projectmetadataitem/v1beta1.py | 249 + .../gcp/compute/regionautoscaler/__init__.py | 0 .../gcp/compute/regionautoscaler/v1beta1.py | 535 ++ .../gcp/compute/regionautoscaler/v1beta2.py | 535 ++ .../compute/regionbackendservice/__init__.py | 0 .../compute/regionbackendservice/v1beta1.py | 1487 ++++++ .../compute/regionbackendservice/v1beta2.py | 1487 ++++++ .../gcp/compute/regiondisk/__init__.py | 0 .../upbound/gcp/compute/regiondisk/v1beta1.py | 798 +++ .../upbound/gcp/compute/regiondisk/v1beta2.py | 796 +++ .../compute/regiondiskiammember/__init__.py | 0 .../compute/regiondiskiammember/v1beta1.py | 275 + .../compute/regiondiskiammember/v1beta2.py | 275 + .../__init__.py | 0 .../v1beta1.py | 352 ++ .../gcp/compute/regionhealthcheck/__init__.py | 0 .../gcp/compute/regionhealthcheck/v1beta1.py | 668 +++ .../gcp/compute/regionhealthcheck/v1beta2.py | 668 +++ .../regioninstancegroupmanager/__init__.py | 0 .../regioninstancegroupmanager/v1beta1.py | 977 ++++ .../regioninstancegroupmanager/v1beta2.py | 985 ++++ .../compute/regionnetworkendpoint/__init__.py | 0 .../compute/regionnetworkendpoint/v1beta1.py | 342 ++ .../regionnetworkendpointgroup/__init__.py | 0 .../regionnetworkendpointgroup/v1beta1.py | 712 +++ .../regionnetworkendpointgroup/v1beta2.py | 712 +++ .../regionnetworkfirewallpolicy/__init__.py | 0 .../regionnetworkfirewallpolicy/v1beta1.py | 271 + .../__init__.py | 0 .../v1beta1.py | 337 ++ .../regionperinstanceconfig/__init__.py | 0 .../regionperinstanceconfig/v1beta1.py | 585 ++ .../regionperinstanceconfig/v1beta2.py | 585 ++ .../compute/regionsecuritypolicy/__init__.py | 0 .../compute/regionsecuritypolicy/v1beta1.py | 763 +++ .../compute/regionsslcertificate/__init__.py | 0 .../compute/regionsslcertificate/v1beta1.py | 317 ++ .../gcp/compute/regionsslpolicy/__init__.py | 0 .../gcp/compute/regionsslpolicy/v1beta1.py | 228 + .../compute/regiontargethttpproxy/__init__.py | 0 .../compute/regiontargethttpproxy/v1beta1.py | 341 ++ .../regiontargethttpsproxy/__init__.py | 0 .../compute/regiontargethttpsproxy/v1beta1.py | 486 ++ .../compute/regiontargettcpproxy/__init__.py | 0 .../compute/regiontargettcpproxy/v1beta1.py | 350 ++ .../gcp/compute/regionurlmap/__init__.py | 0 .../gcp/compute/regionurlmap/v1beta1.py | 2405 +++++++++ .../gcp/compute/regionurlmap/v1beta2.py | 2405 +++++++++ .../gcp/compute/reservation/__init__.py | 0 .../gcp/compute/reservation/v1beta1.py | 525 ++ .../gcp/compute/reservation/v1beta2.py | 525 ++ .../gcp/compute/resourcepolicy/__init__.py | 0 .../gcp/compute/resourcepolicy/v1beta1.py | 533 ++ .../gcp/compute/resourcepolicy/v1beta2.py | 533 ++ .../io/upbound/gcp/compute/route/__init__.py | 0 .../io/upbound/gcp/compute/route/v1beta1.py | 651 +++ .../io/upbound/gcp/compute/router/__init__.py | 0 .../io/upbound/gcp/compute/router/v1beta1.py | 431 ++ .../io/upbound/gcp/compute/router/v1beta2.py | 431 ++ .../gcp/compute/routerinterface/__init__.py | 0 .../gcp/compute/routerinterface/v1beta1.py | 464 ++ .../upbound/gcp/compute/routernat/__init__.py | 0 .../upbound/gcp/compute/routernat/v1beta1.py | 882 +++ .../upbound/gcp/compute/routernat/v1beta2.py | 985 ++++ .../gcp/compute/routerpeer/__init__.py | 0 .../upbound/gcp/compute/routerpeer/v1beta1.py | 912 ++++ .../upbound/gcp/compute/routerpeer/v1beta2.py | 961 ++++ .../gcp/compute/securitypolicy/__init__.py | 0 .../gcp/compute/securitypolicy/v1beta1.py | 724 +++ .../gcp/compute/securitypolicy/v1beta2.py | 724 +++ .../gcp/compute/serviceattachment/__init__.py | 0 .../gcp/compute/serviceattachment/v1beta1.py | 620 +++ .../compute/sharedvpchostproject/__init__.py | 0 .../compute/sharedvpchostproject/v1beta1.py | 265 + .../sharedvpcserviceproject/__init__.py | 0 .../sharedvpcserviceproject/v1beta1.py | 332 ++ .../upbound/gcp/compute/snapshot/__init__.py | 0 .../upbound/gcp/compute/snapshot/v1beta1.py | 583 ++ .../upbound/gcp/compute/snapshot/v1beta2.py | 572 ++ .../gcp/compute/snapshotiammember/__init__.py | 0 .../gcp/compute/snapshotiammember/v1beta1.py | 229 + .../gcp/compute/snapshotiammember/v1beta2.py | 229 + .../gcp/compute/sslcertificate/__init__.py | 0 .../gcp/compute/sslcertificate/v1beta1.py | 307 ++ .../upbound/gcp/compute/sslpolicy/__init__.py | 0 .../upbound/gcp/compute/sslpolicy/v1beta1.py | 347 ++ .../gcp/compute/subnetwork/__init__.py | 0 .../upbound/gcp/compute/subnetwork/v1beta1.py | 741 +++ .../upbound/gcp/compute/subnetwork/v1beta2.py | 741 +++ .../compute/subnetworkiammember/__init__.py | 0 .../compute/subnetworkiammember/v1beta1.py | 275 + .../compute/subnetworkiammember/v1beta2.py | 275 + .../gcp/compute/targetgrpcproxy/__init__.py | 0 .../gcp/compute/targetgrpcproxy/v1beta1.py | 359 ++ .../gcp/compute/targethttpproxy/__init__.py | 0 .../gcp/compute/targethttpproxy/v1beta1.py | 366 ++ .../gcp/compute/targethttpsproxy/__init__.py | 0 .../gcp/compute/targethttpsproxy/v1beta1.py | 589 ++ .../gcp/compute/targetinstance/__init__.py | 0 .../gcp/compute/targetinstance/v1beta1.py | 344 ++ .../gcp/compute/targetpool/__init__.py | 0 .../upbound/gcp/compute/targetpool/v1beta1.py | 372 ++ .../gcp/compute/targetsslproxy/__init__.py | 0 .../gcp/compute/targetsslproxy/v1beta1.py | 422 ++ .../gcp/compute/targettcpproxy/__init__.py | 0 .../gcp/compute/targettcpproxy/v1beta1.py | 340 ++ .../io/upbound/gcp/compute/urlmap/__init__.py | 0 .../io/upbound/gcp/compute/urlmap/v1beta1.py | 2677 ++++++++++ .../io/upbound/gcp/compute/urlmap/v1beta2.py | 2667 ++++++++++ .../gcp/compute/vpngateway/__init__.py | 0 .../upbound/gcp/compute/vpngateway/v1beta1.py | 312 ++ .../upbound/gcp/compute/vpntunnel/__init__.py | 0 .../upbound/gcp/compute/vpntunnel/v1beta1.py | 667 +++ .../io/upbound/gcp/container/__init__.py | 0 .../upbound/gcp/container/cluster/__init__.py | 0 .../upbound/gcp/container/cluster/v1beta1.py | 4009 ++++++++++++++ .../upbound/gcp/container/cluster/v1beta2.py | 3992 ++++++++++++++ .../gcp/container/nodepool/__init__.py | 0 .../upbound/gcp/container/nodepool/v1beta1.py | 1065 ++++ .../upbound/gcp/container/nodepool/v1beta2.py | 1084 ++++ .../gcp/container/registry/__init__.py | 0 .../upbound/gcp/container/registry/v1beta1.py | 238 + .../python/models/io/upbound/m/__init__.py | 0 .../models/io/upbound/m/gcp/__init__.py | 0 .../upbound/m/gcp/cloudplatform/__init__.py | 0 .../m/gcp/cloudplatform/folder/__init__.py | 0 .../m/gcp/cloudplatform/folder/v1beta1.py | 313 ++ .../cloudplatform/folderiammember/__init__.py | 0 .../cloudplatform/folderiammember/v1beta1.py | 261 + .../organizationiamauditconfig/__init__.py | 0 .../organizationiamauditconfig/v1beta1.py | 189 + .../organizationiamcustomrole/__init__.py | 0 .../organizationiamcustomrole/v1beta1.py | 263 + .../organizationiammember/__init__.py | 0 .../organizationiammember/v1beta1.py | 193 + .../m/gcp/cloudplatform/project/__init__.py | 0 .../m/gcp/cloudplatform/project/v1beta1.py | 422 ++ .../projectdefaultserviceaccounts/__init__.py | 0 .../projectdefaultserviceaccounts/v1beta1.py | 296 ++ .../projectiamauditconfig/__init__.py | 0 .../projectiamauditconfig/v1beta1.py | 257 + .../projectiamcustomrole/__init__.py | 0 .../projectiamcustomrole/v1beta1.py | 254 + .../projectiammember/__init__.py | 0 .../cloudplatform/projectiammember/v1beta1.py | 261 + .../cloudplatform/projectservice/__init__.py | 0 .../cloudplatform/projectservice/v1beta1.py | 311 ++ .../projectusageexportbucket/__init__.py | 0 .../projectusageexportbucket/v1beta1.py | 329 ++ .../cloudplatform/serviceaccount/__init__.py | 0 .../cloudplatform/serviceaccount/v1beta1.py | 267 + .../serviceaccountiammember/__init__.py | 0 .../serviceaccountiammember/v1beta1.py | 261 + .../serviceaccountkey/__init__.py | 0 .../serviceaccountkey/v1beta1.py | 358 ++ .../__init__.py | 0 .../v1beta1.py | 223 + .../io/upbound/m/gcp/compute/__init__.py | 0 .../upbound/m/gcp/compute/address/__init__.py | 0 .../upbound/m/gcp/compute/address/v1beta1.py | 530 ++ .../m/gcp/compute/attacheddisk/__init__.py | 0 .../m/gcp/compute/attacheddisk/v1beta1.py | 413 ++ .../m/gcp/compute/autoscaler/__init__.py | 0 .../m/gcp/compute/autoscaler/v1beta1.py | 527 ++ .../m/gcp/compute/backendbucket/__init__.py | 0 .../m/gcp/compute/backendbucket/v1beta1.py | 528 ++ .../backendbucketsignedurlkey/__init__.py | 0 .../backendbucketsignedurlkey/v1beta1.py | 304 ++ .../m/gcp/compute/backendservice/__init__.py | 0 .../m/gcp/compute/backendservice/v1beta1.py | 1875 +++++++ .../backendservicesignedurlkey/__init__.py | 0 .../backendservicesignedurlkey/v1beta1.py | 304 ++ .../io/upbound/m/gcp/compute/disk/__init__.py | 0 .../io/upbound/m/gcp/compute/disk/v1beta1.py | 997 ++++ .../m/gcp/compute/diskiammember/__init__.py | 0 .../m/gcp/compute/diskiammember/v1beta1.py | 267 + .../diskresourcepolicyattachment/__init__.py | 0 .../diskresourcepolicyattachment/v1beta1.py | 352 ++ .../compute/externalvpngateway/__init__.py | 0 .../gcp/compute/externalvpngateway/v1beta1.py | 291 + .../m/gcp/compute/firewall/__init__.py | 0 .../upbound/m/gcp/compute/firewall/v1beta1.py | 695 +++ .../m/gcp/compute/firewallpolicy/__init__.py | 0 .../m/gcp/compute/firewallpolicy/v1beta1.py | 247 + .../firewallpolicyassociation/__init__.py | 0 .../firewallpolicyassociation/v1beta1.py | 348 ++ .../compute/firewallpolicyrule/__init__.py | 0 .../gcp/compute/firewallpolicyrule/v1beta1.py | 714 +++ .../m/gcp/compute/forwardingrule/__init__.py | 0 .../m/gcp/compute/forwardingrule/v1beta1.py | 1062 ++++ .../m/gcp/compute/globaladdress/__init__.py | 0 .../m/gcp/compute/globaladdress/v1beta1.py | 405 ++ .../compute/globalforwardingrule/__init__.py | 0 .../compute/globalforwardingrule/v1beta1.py | 980 ++++ .../compute/globalnetworkendpoint/__init__.py | 0 .../compute/globalnetworkendpoint/v1beta1.py | 315 ++ .../globalnetworkendpointgroup/__init__.py | 0 .../globalnetworkendpointgroup/v1beta1.py | 241 + .../m/gcp/compute/havpngateway/__init__.py | 0 .../m/gcp/compute/havpngateway/v1beta1.py | 462 ++ .../m/gcp/compute/healthcheck/__init__.py | 0 .../m/gcp/compute/healthcheck/v1beta1.py | 648 +++ .../m/gcp/compute/httphealthcheck/__init__.py | 0 .../m/gcp/compute/httphealthcheck/v1beta1.py | 326 ++ .../gcp/compute/httpshealthcheck/__init__.py | 0 .../m/gcp/compute/httpshealthcheck/v1beta1.py | 326 ++ .../upbound/m/gcp/compute/image/__init__.py | 0 .../io/upbound/m/gcp/compute/image/v1beta1.py | 856 +++ .../m/gcp/compute/imageiammember/__init__.py | 0 .../m/gcp/compute/imageiammember/v1beta1.py | 264 + .../m/gcp/compute/instance/__init__.py | 0 .../upbound/m/gcp/compute/instance/v1beta1.py | 1908 +++++++ .../compute/instancefromtemplate/__init__.py | 0 .../compute/instancefromtemplate/v1beta1.py | 853 +++ .../m/gcp/compute/instancegroup/__init__.py | 0 .../m/gcp/compute/instancegroup/v1beta1.py | 404 ++ .../compute/instancegroupmanager/__init__.py | 0 .../compute/instancegroupmanager/v1beta1.py | 978 ++++ .../instancegroupnamedport/__init__.py | 0 .../compute/instancegroupnamedport/v1beta1.py | 243 + .../gcp/compute/instanceiammember/__init__.py | 0 .../gcp/compute/instanceiammember/v1beta1.py | 267 + .../gcp/compute/instancetemplate/__init__.py | 0 .../m/gcp/compute/instancetemplate/v1beta1.py | 1608 ++++++ .../interconnectattachment/__init__.py | 0 .../compute/interconnectattachment/v1beta1.py | 740 +++ .../compute/managedsslcertificate/__init__.py | 0 .../compute/managedsslcertificate/v1beta1.py | 271 + .../upbound/m/gcp/compute/network/__init__.py | 0 .../upbound/m/gcp/compute/network/v1beta1.py | 459 ++ .../m/gcp/compute/networkendpoint/__init__.py | 0 .../m/gcp/compute/networkendpoint/v1beta1.py | 389 ++ .../compute/networkendpointgroup/__init__.py | 0 .../compute/networkendpointgroup/v1beta1.py | 427 ++ .../compute/networkfirewallpolicy/__init__.py | 0 .../compute/networkfirewallpolicy/v1beta1.py | 228 + .../__init__.py | 0 .../v1beta1.py | 329 ++ .../networkfirewallpolicyrule/__init__.py | 0 .../networkfirewallpolicyrule/v1beta1.py | 698 +++ .../m/gcp/compute/networkpeering/__init__.py | 0 .../m/gcp/compute/networkpeering/v1beta1.py | 380 ++ .../networkpeeringroutesconfig/__init__.py | 0 .../networkpeeringroutesconfig/v1beta1.py | 395 ++ .../m/gcp/compute/nodegroup/__init__.py | 0 .../m/gcp/compute/nodegroup/v1beta1.py | 524 ++ .../m/gcp/compute/nodetemplate/__init__.py | 0 .../m/gcp/compute/nodetemplate/v1beta1.py | 421 ++ .../m/gcp/compute/packetmirroring/__init__.py | 0 .../m/gcp/compute/packetmirroring/v1beta1.py | 467 ++ .../gcp/compute/perinstanceconfig/__init__.py | 0 .../gcp/compute/perinstanceconfig/v1beta1.py | 589 ++ .../projectdefaultnetworktier/__init__.py | 0 .../projectdefaultnetworktier/v1beta1.py | 207 + .../m/gcp/compute/projectmetadata/__init__.py | 0 .../m/gcp/compute/projectmetadata/v1beta1.py | 204 + .../compute/projectmetadataitem/__init__.py | 0 .../compute/projectmetadataitem/v1beta1.py | 216 + .../gcp/compute/regionautoscaler/__init__.py | 0 .../m/gcp/compute/regionautoscaler/v1beta1.py | 527 ++ .../compute/regionbackendservice/__init__.py | 0 .../compute/regionbackendservice/v1beta1.py | 1480 ++++++ .../m/gcp/compute/regiondisk/__init__.py | 0 .../m/gcp/compute/regiondisk/v1beta1.py | 782 +++ .../compute/regiondiskiammember/__init__.py | 0 .../compute/regiondiskiammember/v1beta1.py | 267 + .../__init__.py | 0 .../v1beta1.py | 352 ++ .../gcp/compute/regionhealthcheck/__init__.py | 0 .../gcp/compute/regionhealthcheck/v1beta1.py | 635 +++ .../regioninstancegroupmanager/__init__.py | 0 .../regioninstancegroupmanager/v1beta1.py | 993 ++++ .../compute/regionnetworkendpoint/__init__.py | 0 .../compute/regionnetworkendpoint/v1beta1.py | 334 ++ .../regionnetworkendpointgroup/__init__.py | 0 .../regionnetworkendpointgroup/v1beta1.py | 736 +++ .../regionnetworkfirewallpolicy/__init__.py | 0 .../regionnetworkfirewallpolicy/v1beta1.py | 238 + .../__init__.py | 0 .../v1beta1.py | 337 ++ .../regionperinstanceconfig/__init__.py | 0 .../regionperinstanceconfig/v1beta1.py | 593 +++ .../compute/regionsecuritypolicy/__init__.py | 0 .../compute/regionsecuritypolicy/v1beta1.py | 730 +++ .../compute/regionsslcertificate/__init__.py | 0 .../compute/regionsslcertificate/v1beta1.py | 270 + .../m/gcp/compute/regionsslpolicy/__init__.py | 0 .../m/gcp/compute/regionsslpolicy/v1beta1.py | 195 + .../compute/regiontargethttpproxy/__init__.py | 0 .../compute/regiontargethttpproxy/v1beta1.py | 333 ++ .../regiontargethttpsproxy/__init__.py | 0 .../compute/regiontargethttpsproxy/v1beta1.py | 486 ++ .../compute/regiontargettcpproxy/__init__.py | 0 .../compute/regiontargettcpproxy/v1beta1.py | 342 ++ .../m/gcp/compute/regionurlmap/__init__.py | 0 .../m/gcp/compute/regionurlmap/v1beta1.py | 2413 +++++++++ .../m/gcp/compute/reservation/__init__.py | 0 .../m/gcp/compute/reservation/v1beta1.py | 517 ++ .../m/gcp/compute/resourcepolicy/__init__.py | 0 .../m/gcp/compute/resourcepolicy/v1beta1.py | 500 ++ .../upbound/m/gcp/compute/route/__init__.py | 0 .../io/upbound/m/gcp/compute/route/v1beta1.py | 659 +++ .../upbound/m/gcp/compute/router/__init__.py | 0 .../upbound/m/gcp/compute/router/v1beta1.py | 423 ++ .../m/gcp/compute/routerinterface/__init__.py | 0 .../m/gcp/compute/routerinterface/v1beta1.py | 464 ++ .../m/gcp/compute/routernat/__init__.py | 0 .../m/gcp/compute/routernat/v1beta1.py | 1009 ++++ .../m/gcp/compute/routerpeer/__init__.py | 0 .../m/gcp/compute/routerpeer/v1beta1.py | 978 ++++ .../m/gcp/compute/securitypolicy/__init__.py | 0 .../m/gcp/compute/securitypolicy/v1beta1.py | 691 +++ .../gcp/compute/serviceattachment/__init__.py | 0 .../gcp/compute/serviceattachment/v1beta1.py | 628 +++ .../compute/sharedvpchostproject/__init__.py | 0 .../compute/sharedvpchostproject/v1beta1.py | 257 + .../sharedvpcserviceproject/__init__.py | 0 .../sharedvpcserviceproject/v1beta1.py | 332 ++ .../m/gcp/compute/snapshot/__init__.py | 0 .../upbound/m/gcp/compute/snapshot/v1beta1.py | 550 ++ .../gcp/compute/snapshotiammember/__init__.py | 0 .../gcp/compute/snapshotiammember/v1beta1.py | 196 + .../m/gcp/compute/sslcertificate/__init__.py | 0 .../m/gcp/compute/sslcertificate/v1beta1.py | 260 + .../m/gcp/compute/sslpolicy/__init__.py | 0 .../m/gcp/compute/sslpolicy/v1beta1.py | 314 ++ .../m/gcp/compute/subnetwork/__init__.py | 0 .../m/gcp/compute/subnetwork/v1beta1.py | 733 +++ .../compute/subnetworkiammember/__init__.py | 0 .../compute/subnetworkiammember/v1beta1.py | 267 + .../m/gcp/compute/targetgrpcproxy/__init__.py | 0 .../m/gcp/compute/targetgrpcproxy/v1beta1.py | 351 ++ .../m/gcp/compute/targethttpproxy/__init__.py | 0 .../m/gcp/compute/targethttpproxy/v1beta1.py | 358 ++ .../gcp/compute/targethttpsproxy/__init__.py | 0 .../m/gcp/compute/targethttpsproxy/v1beta1.py | 589 ++ .../m/gcp/compute/targetinstance/__init__.py | 0 .../m/gcp/compute/targetinstance/v1beta1.py | 336 ++ .../m/gcp/compute/targetpool/__init__.py | 0 .../m/gcp/compute/targetpool/v1beta1.py | 364 ++ .../m/gcp/compute/targetsslproxy/__init__.py | 0 .../m/gcp/compute/targetsslproxy/v1beta1.py | 422 ++ .../m/gcp/compute/targettcpproxy/__init__.py | 0 .../m/gcp/compute/targettcpproxy/v1beta1.py | 332 ++ .../upbound/m/gcp/compute/urlmap/__init__.py | 0 .../upbound/m/gcp/compute/urlmap/v1beta1.py | 2683 ++++++++++ .../m/gcp/compute/vpngateway/__init__.py | 0 .../m/gcp/compute/vpngateway/v1beta1.py | 304 ++ .../m/gcp/compute/vpntunnel/__init__.py | 0 .../m/gcp/compute/vpntunnel/v1beta1.py | 676 +++ .../io/upbound/m/gcp/container/__init__.py | 0 .../m/gcp/container/cluster/__init__.py | 0 .../m/gcp/container/cluster/v1beta1.py | 4008 ++++++++++++++ .../m/gcp/container/nodepool/__init__.py | 0 .../m/gcp/container/nodepool/v1beta1.py | 1084 ++++ .../m/gcp/container/registry/__init__.py | 0 .../m/gcp/container/registry/v1beta1.py | 205 + schemas/python/pyproject.toml | 11 + 641 files changed, 187435 insertions(+), 1 deletion(-) create mode 100644 schemas/python/models/__init__.py create mode 100644 schemas/python/models/ai/__init__.py create mode 100644 schemas/python/models/ai/modelplane/__init__.py create mode 100644 schemas/python/models/ai/modelplane/inferenceclass/__init__.py create mode 100644 schemas/python/models/ai/modelplane/inferenceclass/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/inferencecluster/__init__.py create mode 100644 schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/inferencegateway/__init__.py create mode 100644 schemas/python/models/ai/modelplane/inferencegateway/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/infrastructure/__init__.py create mode 100644 schemas/python/models/ai/modelplane/infrastructure/gkecluster/__init__.py create mode 100644 schemas/python/models/ai/modelplane/infrastructure/gkecluster/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/infrastructure/kservebackend/__init__.py create mode 100644 schemas/python/models/ai/modelplane/infrastructure/kservebackend/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/modeldeployment/__init__.py create mode 100644 schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/modelendpoint/__init__.py create mode 100644 schemas/python/models/ai/modelplane/modelendpoint/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/modelreplica/__init__.py create mode 100644 schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py create mode 100644 schemas/python/models/ai/modelplane/modelservice/__init__.py create mode 100644 schemas/python/models/ai/modelplane/modelservice/v1alpha1.py create mode 100644 schemas/python/models/io/__init__.py create mode 100644 schemas/python/models/io/crossplane/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v1.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v2.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/composition/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/composition/v1.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/compositionrevision/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/compositionrevision/v1.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/environmentconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/environmentconfig/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/managedresourceactivationpolicy/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/managedresourceactivationpolicy/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/managedresourcedefinition/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/managedresourcedefinition/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/usage/__init__.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/usage/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/apiextensions/usage/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/helm/__init__.py create mode 100644 schemas/python/models/io/crossplane/helm/providerconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/helm/providerconfig/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/helm/providerconfig/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/helm/providerconfigusage/__init__.py create mode 100644 schemas/python/models/io/crossplane/helm/providerconfigusage/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/helm/providerconfigusage/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/helm/release/__init__.py create mode 100644 schemas/python/models/io/crossplane/helm/release/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/helm/release/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/__init__.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/object/__init__.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/object/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/object/v1alpha2.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/observedobjectcollection/__init__.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/observedobjectcollection/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/providerconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/providerconfig/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/providerconfigusage/__init__.py create mode 100644 schemas/python/models/io/crossplane/kubernetes/providerconfigusage/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/m/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/helm/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/helm/clusterproviderconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/helm/clusterproviderconfig/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/m/helm/providerconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/helm/providerconfig/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/m/helm/providerconfigusage/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/helm/providerconfigusage/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/m/helm/release/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/helm/release/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/clusterproviderconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/clusterproviderconfig/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/object/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/object/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/observedobjectcollection/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/observedobjectcollection/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/providerconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/providerconfig/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/providerconfigusage/__init__.py create mode 100644 schemas/python/models/io/crossplane/m/kubernetes/providerconfigusage/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/ops/__init__.py create mode 100644 schemas/python/models/io/crossplane/ops/cronoperation/__init__.py create mode 100644 schemas/python/models/io/crossplane/ops/cronoperation/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/ops/operation/__init__.py create mode 100644 schemas/python/models/io/crossplane/ops/operation/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/ops/watchoperation/__init__.py create mode 100644 schemas/python/models/io/crossplane/ops/watchoperation/v1alpha1.py create mode 100644 schemas/python/models/io/crossplane/pkg/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/configuration/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/configuration/v1.py create mode 100644 schemas/python/models/io/crossplane/pkg/configurationrevision/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/configurationrevision/v1.py create mode 100644 schemas/python/models/io/crossplane/pkg/deploymentruntimeconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/deploymentruntimeconfig/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/pkg/function/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/function/v1.py create mode 100644 schemas/python/models/io/crossplane/pkg/function/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/pkg/functionrevision/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/functionrevision/v1.py create mode 100644 schemas/python/models/io/crossplane/pkg/functionrevision/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/pkg/imageconfig/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/imageconfig/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/pkg/lock/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/lock/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/pkg/provider/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/provider/v1.py create mode 100644 schemas/python/models/io/crossplane/pkg/providerrevision/__init__.py create mode 100644 schemas/python/models/io/crossplane/pkg/providerrevision/v1.py create mode 100644 schemas/python/models/io/crossplane/protection/__init__.py create mode 100644 schemas/python/models/io/crossplane/protection/clusterusage/__init__.py create mode 100644 schemas/python/models/io/crossplane/protection/clusterusage/v1beta1.py create mode 100644 schemas/python/models/io/crossplane/protection/usage/__init__.py create mode 100644 schemas/python/models/io/crossplane/protection/usage/v1beta1.py create mode 100644 schemas/python/models/io/k8s/__init__.py create mode 100644 schemas/python/models/io/k8s/apimachinery/__init__.py create mode 100644 schemas/python/models/io/k8s/apimachinery/pkg/__init__.py create mode 100644 schemas/python/models/io/k8s/apimachinery/pkg/apis/__init__.py create mode 100644 schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/__init__.py create mode 100644 schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py create mode 100644 schemas/python/models/io/upbound/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/folder/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/folder/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamauditconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamcustomrole/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/project/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/project/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectdefaultserviceaccounts/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectiamauditconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectiamauditconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectiamcustomrole/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectiamcustomrole/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectservice/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectservice/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectusageexportbucket/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/projectusageexportbucket/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccount/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccount/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountkey/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountkey/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/servicenetworkingpeereddnsdomain/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/address/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/address/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/attacheddisk/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/attacheddisk/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/autoscaler/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendbucket/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendbucketsignedurlkey/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendbucketsignedurlkey/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendservice/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendservicesignedurlkey/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/backendservicesignedurlkey/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/disk/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/disk/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/disk/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/diskiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/diskresourcepolicyattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/diskresourcepolicyattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/externalvpngateway/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/externalvpngateway/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewall/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewall/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewall/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewallpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewallpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewallpolicyassociation/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewallpolicyassociation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/forwardingrule/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globaladdress/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globaladdress/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globalnetworkendpoint/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globalnetworkendpoint/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globalnetworkendpointgroup/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/globalnetworkendpointgroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/havpngateway/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/havpngateway/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/healthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/httphealthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/httphealthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/httpshealthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/httpshealthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/image/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/image/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/image/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/imageiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instance/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instance/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instance/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancegroup/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancegroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancegroupnamedport/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancegroupnamedport/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instanceiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancetemplate/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/interconnectattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/interconnectattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/network/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/network/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkendpoint/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkendpoint/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkendpointgroup/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkendpointgroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyassociation/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyassociation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyrule/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkpeering/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkpeering/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkpeeringroutesconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/networkpeeringroutesconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/nodegroup/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/nodetemplate/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/packetmirroring/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/projectdefaultnetworktier/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/projectdefaultnetworktier/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/projectmetadata/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/projectmetadata/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/projectmetadataitem/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/projectmetadataitem/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionautoscaler/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionbackendservice/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondisk/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondiskresourcepolicyattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkendpoint/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkendpoint/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicyassociation/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionsecuritypolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionsecuritypolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionsslcertificate/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionsslcertificate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionsslpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionsslpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiontargethttpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiontargethttpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiontargethttpsproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiontargethttpsproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiontargettcpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regiontargettcpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionurlmap/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/reservation/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/reservation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/reservation/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/resourcepolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/route/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/route/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/router/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/router/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/router/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routerinterface/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routerinterface/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routernat/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routernat/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routernat/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routerpeer/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/securitypolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/serviceattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/serviceattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sharedvpchostproject/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sharedvpchostproject/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sharedvpcserviceproject/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sharedvpcserviceproject/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/snapshot/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/snapshotiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sslcertificate/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sslcertificate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sslpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/sslpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/subnetwork/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetgrpcproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetgrpcproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targethttpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targethttpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targethttpsproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targethttpsproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetinstance/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetinstance/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetpool/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetpool/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetsslproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targetsslproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targettcpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/targettcpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/urlmap/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/vpngateway/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/vpngateway/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/vpntunnel/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/compute/vpntunnel/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/container/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/container/cluster/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/container/cluster/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/container/cluster/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/container/nodepool/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/container/nodepool/v1beta1.py create mode 100644 schemas/python/models/io/upbound/gcp/container/nodepool/v1beta2.py create mode 100644 schemas/python/models/io/upbound/gcp/container/registry/__init__.py create mode 100644 schemas/python/models/io/upbound/gcp/container/registry/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/folder/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/folder/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/folderiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/folderiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamauditconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamcustomrole/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/project/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/project/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectdefaultserviceaccounts/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamauditconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamauditconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamcustomrole/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamcustomrole/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectservice/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectservice/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectusageexportbucket/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/projectusageexportbucket/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccount/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccount/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountkey/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountkey/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/servicenetworkingpeereddnsdomain/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/address/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/address/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/attacheddisk/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/attacheddisk/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/autoscaler/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/autoscaler/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendbucket/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendbucket/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendbucketsignedurlkey/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendbucketsignedurlkey/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendservice/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendservice/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendservicesignedurlkey/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/backendservicesignedurlkey/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/disk/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/disk/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/diskiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/diskiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/diskresourcepolicyattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/diskresourcepolicyattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/externalvpngateway/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/externalvpngateway/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewall/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewall/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewallpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewallpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyassociation/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyassociation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyrule/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/forwardingrule/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/forwardingrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globaladdress/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globaladdress/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globalforwardingrule/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globalforwardingrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpoint/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpoint/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpointgroup/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpointgroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/havpngateway/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/havpngateway/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/healthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/healthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/httphealthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/httphealthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/httpshealthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/httpshealthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/image/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/image/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/imageiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/imageiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instance/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instance/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancefromtemplate/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancefromtemplate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancegroup/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancegroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancegroupmanager/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancegroupmanager/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancegroupnamedport/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancegroupnamedport/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instanceiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instanceiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancetemplate/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/instancetemplate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/interconnectattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/interconnectattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/managedsslcertificate/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/managedsslcertificate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/network/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/network/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkendpoint/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkendpoint/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkendpointgroup/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkendpointgroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyassociation/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyassociation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyrule/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyrule/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkpeering/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkpeering/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkpeeringroutesconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/networkpeeringroutesconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/nodegroup/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/nodegroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/nodetemplate/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/nodetemplate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/packetmirroring/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/packetmirroring/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/perinstanceconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/perinstanceconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/projectdefaultnetworktier/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/projectdefaultnetworktier/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/projectmetadata/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/projectmetadata/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/projectmetadataitem/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/projectmetadataitem/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionautoscaler/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionautoscaler/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionbackendservice/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionbackendservice/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiondisk/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiondisk/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiondiskiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiondiskiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiondiskresourcepolicyattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionhealthcheck/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionhealthcheck/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regioninstancegroupmanager/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regioninstancegroupmanager/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpoint/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpoint/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpointgroup/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpointgroup/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicyassociation/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionperinstanceconfig/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionperinstanceconfig/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionsecuritypolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionsecuritypolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionsslcertificate/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionsslcertificate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionsslpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionsslpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpsproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpsproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiontargettcpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regiontargettcpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionurlmap/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/regionurlmap/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/reservation/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/reservation/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/resourcepolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/resourcepolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/route/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/route/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/router/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/router/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/routerinterface/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/routerinterface/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/routernat/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/routernat/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/routerpeer/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/routerpeer/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/securitypolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/securitypolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/serviceattachment/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/serviceattachment/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sharedvpchostproject/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sharedvpchostproject/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sharedvpcserviceproject/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sharedvpcserviceproject/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/snapshot/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/snapshot/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/snapshotiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/snapshotiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sslcertificate/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sslcertificate/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sslpolicy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/sslpolicy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/subnetwork/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/subnetwork/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/subnetworkiammember/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/subnetworkiammember/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetgrpcproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetgrpcproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targethttpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targethttpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targethttpsproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targethttpsproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetinstance/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetinstance/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetpool/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetpool/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetsslproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targetsslproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targettcpproxy/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/targettcpproxy/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/urlmap/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/urlmap/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/vpngateway/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/vpngateway/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/vpntunnel/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/compute/vpntunnel/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/container/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/container/cluster/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/container/cluster/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/container/nodepool/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/container/nodepool/v1beta1.py create mode 100644 schemas/python/models/io/upbound/m/gcp/container/registry/__init__.py create mode 100644 schemas/python/models/io/upbound/m/gcp/container/registry/v1beta1.py create mode 100644 schemas/python/pyproject.toml diff --git a/.gitignore b/.gitignore index 60791731a..4ce104b67 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ .venv-* _output .up -schemas/ +schemas/* +!schemas/python/ result .direnv __pycache__/ diff --git a/schemas/python/models/__init__.py b/schemas/python/models/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/__init__.py b/schemas/python/models/ai/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/__init__.py b/schemas/python/models/ai/modelplane/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/inferenceclass/__init__.py b/schemas/python/models/ai/modelplane/inferenceclass/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/inferenceclass/v1alpha1.py b/schemas/python/models/ai/modelplane/inferenceclass/v1alpha1.py new file mode 100644 index 000000000..9e421b456 --- /dev/null +++ b/schemas/python/models/ai/modelplane/inferenceclass/v1alpha1.py @@ -0,0 +1,148 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_inferenceclass.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, conint, constr + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + namespace: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class Accelerator(BaseModel): + count: conint(ge=1, le=16) + type: constr(min_length=1, max_length=63) + """ + GPU accelerator type passed to GCP (e.g. nvidia-l4, nvidia-h100-80gb). + """ + + +class Gke(BaseModel): + accelerator: Accelerator + diskSizeGb: Optional[conint(ge=10)] = 100 + machineType: constr(min_length=1) + + +class Provisioning(BaseModel): + gke: Optional[Gke] = None + provider: Literal['GKE'] = 'GKE' + + +class Gpu(BaseModel): + count: conint(ge=1, le=16) + """ + GPUs per node. + """ + memory: constr(min_length=1, max_length=16) + """ + Per-GPU VRAM (e.g. "24Gi", "80Gi"). + """ + + +class Resources(BaseModel): + gpu: Gpu + + +class Spec(BaseModel): + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + description: Optional[str] = None + """ + Human-readable description of the class. + """ + provisioning: Optional[Provisioning] = None + """ + How to provision a node pool of this class. Omit for classes that describe BYO node pools that already exist. + """ + resources: Resources + """ + Hardware resources a node of this class exposes. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class InferenceClass(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['InferenceClass']] = 'InferenceClass' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + status: Optional[Status] = None + + +class InferenceClassList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InferenceClass] + """ + List of inferenceclasses. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/inferencecluster/__init__.py b/schemas/python/models/ai/modelplane/inferencecluster/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py b/schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py new file mode 100644 index 000000000..10166418b --- /dev/null +++ b/schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py @@ -0,0 +1,208 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_inferencecluster.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, conint, constr + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class IdentitySecretRef(BaseModel): + key: Optional[constr(min_length=1, max_length=253)] = 'private_key' + name: constr(min_length=1, max_length=253) + + +class SecretRef(BaseModel): + key: Optional[constr(min_length=1, max_length=253)] = 'kubeconfig' + name: constr(min_length=1, max_length=253) + + +class Existing(BaseModel): + identitySecretRef: Optional[IdentitySecretRef] = None + """ + Optional reference to a Secret containing cloud provider credentials for IAM-based authentication. + """ + secretRef: SecretRef + """ + Reference to a Secret containing a kubeconfig for the existing cluster. The Secret must exist in the modelplane-system namespace. + """ + + +class Gke(BaseModel): + kubernetesVersion: Optional[str] = '1.35' + project: constr(min_length=6, max_length=30) + region: constr(min_length=1, max_length=32) + + +class Cluster(BaseModel): + existing: Optional[Existing] = None + """ + Bring-your-own cluster configuration. Required when source is Existing. Modelplane manages the inference stack on the cluster but does not provision the cluster itself. + """ + gke: Optional[Gke] = None + """ + GKE cluster configuration. Required when source is GKE. + """ + source: Literal['GKE', 'Existing'] + """ + Cluster provisioning method. + """ + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + namespace: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class NodePool(BaseModel): + className: constr(min_length=1, max_length=253) + """ + Name of the InferenceClass describing this pool's hardware. + """ + maxNodeCount: Optional[conint(ge=1)] = None + """ + Maximum node count for autoscaling. Omit for fixed-size pools. + """ + minNodeCount: Optional[conint(ge=0)] = None + name: constr(max_length=40) + nodeCount: Optional[conint(ge=0)] = 1 + zones: Optional[List[str]] = None + """ + Zones to restrict this node pool to. Required for provisioned pools because not all zones in a region have every GPU type. + """ + + +class Spec(BaseModel): + cluster: Cluster + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + nodePools: Optional[List[NodePool]] = Field(None, max_length=8, min_length=1) + """ + GPU node pools available on this cluster. Each pool references an InferenceClass that describes the hardware shape and (for provisioned clusters) how to create the pool. System pools for control-plane components are provisioned automatically. + """ + + +class GpuPool(BaseModel): + acceleratorType: Optional[str] = None + countPerNode: Optional[int] = None + memory: Optional[str] = None + """ + Per-GPU VRAM (e.g. "24Gi"). + """ + nodes: Optional[int] = None + """ + Number of nodes in this pool. Derived from maxNodeCount (if autoscaling) or nodeCount. + """ + + +class Capacity(BaseModel): + gpuPools: Optional[List[GpuPool]] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Gateway(BaseModel): + address: Optional[str] = None + """ + External IP of the inference gateway on the remote cluster. Used by ModelDeployment for unified endpoint routing. + """ + + +class ProviderConfigRef(BaseModel): + name: Optional[str] = None + """ + Name of the ProviderConfig targeting the remote cluster. Used by ModelReplica to create resources on the cluster. + """ + + +class Status(BaseModel): + capacity: Optional[Capacity] = None + """ + Declared capacity derived from the referenced classes and the per-pool node counts. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + gateway: Optional[Gateway] = None + namespace: Optional[str] = None + """ + Namespace where the internal XRs (cluster, backend) were created. + """ + providerConfigRef: Optional[ProviderConfigRef] = None + + +class InferenceCluster(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['InferenceCluster']] = 'InferenceCluster' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + status: Optional[Status] = None + + +class InferenceClusterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InferenceCluster] + """ + List of inferenceclusters. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/inferencegateway/__init__.py b/schemas/python/models/ai/modelplane/inferencegateway/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/inferencegateway/v1alpha1.py b/schemas/python/models/ai/modelplane/inferencegateway/v1alpha1.py new file mode 100644 index 000000000..839ee04e9 --- /dev/null +++ b/schemas/python/models/ai/modelplane/inferencegateway/v1alpha1.py @@ -0,0 +1,141 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_inferencegateway.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + namespace: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class Metallb(BaseModel): + addressPool: str + """ + IP address range for the MetalLB pool (e.g. "172.18.255.200-172.18.255.250"). Must be within the cluster's network CIDR. + """ + + +class EnvoyGateway(BaseModel): + loadBalancer: Optional[Literal['MetalLB']] = None + """ + Load balancer implementation for the gateway Service. Omit for cloud environments where a native LB controller is available. + """ + metallb: Optional[Metallb] = None + """ + MetalLB configuration. Required when loadBalancer is MetalLB. Use for kind or bare-metal clusters. + """ + version: Optional[str] = 'v1.3.0' + + +class Gateway(BaseModel): + port: Optional[int] = 80 + + +class Spec(BaseModel): + backend: Literal['EnvoyGateway'] = 'EnvoyGateway' + """ + Gateway implementation. MVP supports EnvoyGateway only. + """ + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + envoyGateway: Optional[EnvoyGateway] = None + """ + Envoy Gateway configuration. Required when backend is EnvoyGateway. + """ + gateway: Optional[Gateway] = None + """ + Gateway listener configuration. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Status(BaseModel): + address: Optional[str] = None + """ + External address of the control plane gateway. Backend-agnostic — works for any routing implementation. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class InferenceGateway(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['InferenceGateway']] = 'InferenceGateway' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + status: Optional[Status] = None + + +class InferenceGatewayList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InferenceGateway] + """ + List of inferencegateways. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/infrastructure/__init__.py b/schemas/python/models/ai/modelplane/infrastructure/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/infrastructure/gkecluster/__init__.py b/schemas/python/models/ai/modelplane/infrastructure/gkecluster/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/infrastructure/gkecluster/v1alpha1.py b/schemas/python/models/ai/modelplane/infrastructure/gkecluster/v1alpha1.py new file mode 100644 index 000000000..422d9a067 --- /dev/null +++ b/schemas/python/models/ai/modelplane/infrastructure/gkecluster/v1alpha1.py @@ -0,0 +1,221 @@ +# generated by datamodel-codegen: +# filename: workdir/infrastructure_modelplane_ai_v1alpha1_gkecluster.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, RootModel, conint, constr + +from .....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class Networking(BaseModel): + nodeCidr: Optional[constr(max_length=18)] = '10.0.0.0/24' + """ + Primary IP range for nodes. + """ + podCidr: Optional[constr(max_length=18)] = '10.1.0.0/16' + """ + Secondary IP range for pods. + """ + serviceCidr: Optional[constr(max_length=18)] = '10.2.0.0/16' + """ + Secondary IP range for services. + """ + + +class Gpu(BaseModel): + acceleratorCount: Optional[conint(ge=1, le=16)] = 1 + """ + Number of GPUs per node. + """ + acceleratorType: constr(min_length=1, max_length=63) + """ + GPU accelerator type (e.g. nvidia-tesla-a100, nvidia-h100-80gb, nvidia-l4). + """ + memory: constr(min_length=1, max_length=16) + """ + Per-GPU VRAM (e.g. "80Gi"). Reported on the consuming InferenceCluster's status and used by the scheduler. + """ + + +class Zone(RootModel[constr(min_length=1, max_length=63)]): + root: constr(min_length=1, max_length=63) + + +class NodePool(BaseModel): + diskSizeGb: Optional[conint(ge=10, le=65536)] = 100 + """ + Boot disk size in GB. + """ + gpu: Optional[Gpu] = None + """ + GPU configuration. Required when role is GPU. + """ + machineType: constr(min_length=1, max_length=63) + """ + GCE machine type (e.g. e2-standard-4, a2-highgpu-8g, g2-standard-48). + """ + maxNodeCount: Optional[conint(ge=0, le=1000)] = 8 + """ + Maximum number of nodes for autoscaling. + """ + minNodeCount: Optional[conint(ge=0, le=1000)] = 0 + """ + Minimum number of nodes for autoscaling. Set to 1 or higher for pools that must always be available. + """ + name: constr(min_length=1, max_length=40) + """ + Unique name for this node pool. Used as a suffix in the GKE NodePool resource name. + """ + nodeCount: Optional[conint(ge=0, le=1000)] = 1 + """ + Initial number of nodes. + """ + role: Literal['System', 'GPU'] + """ + Determines what workloads this pool runs. System pools host controllers, gateways, and infrastructure. GPU pools host inference workloads and are tainted to exclude non-GPU pods. + """ + zones: Optional[List[Zone]] = Field(None, max_length=8, min_length=1) + """ + Zones to restrict this node pool to. Required for GPU pools because not all zones in a region have every GPU type. Example: ["us-central1-a", "us-central1-b"]. + """ + + +class Spec(BaseModel): + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + kubernetesVersion: Optional[constr(min_length=1, max_length=16)] = '1.35' + """ + GKE cluster Kubernetes version. Must be a version supported by the REGULAR release channel. + """ + networking: Optional[Networking] = None + """ + VPC networking configuration. Defaults are suitable for standalone clusters. Override when VPC-peering multiple clusters to avoid CIDR collisions. + """ + nodePools: List[NodePool] = Field(..., max_length=8, min_length=1) + """ + Node pools for the cluster. At least one System pool is required for controllers and infrastructure workloads. + """ + project: constr(min_length=6, max_length=30) + """ + GCP project ID where the cluster will be created. + """ + region: constr(min_length=1, max_length=32) + """ + GCP region for the cluster (e.g. us-central1, europe-west4). + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Secret(BaseModel): + key: constr(max_length=253) + """ + Key within the Secret that holds the credential data. + """ + name: constr(max_length=253) + """ + Name of the Secret. + """ + type: Literal['Kubeconfig', 'GCPServiceAccountKey'] + """ + The type of credential this secret contains. Kubeconfig contains a kubeconfig file with the cluster endpoint and CA certificate. GCPServiceAccountKey contains a GCP service account JSON key that can authenticate to the cluster via GKE IAM. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + secrets: Optional[List[Secret]] = None + """ + Secrets produced by this cluster. Consumers use these to authenticate to the cluster. All secrets are in the same namespace as this GKECluster. + """ + + +class GKECluster(BaseModel): + apiVersion: Optional[Literal['infrastructure.modelplane.ai/v1alpha1']] = ( + 'infrastructure.modelplane.ai/v1alpha1' + ) + """ + 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[Literal['GKECluster']] = 'GKECluster' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GKEClusterSpec defines the desired state of GKECluster. + """ + status: Optional[Status] = None + """ + GKEClusterStatus defines the observed state of GKECluster. + """ + + +class GKEClusterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GKECluster] + """ + List of gkeclusters. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/infrastructure/kservebackend/__init__.py b/schemas/python/models/ai/modelplane/infrastructure/kservebackend/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/infrastructure/kservebackend/v1alpha1.py b/schemas/python/models/ai/modelplane/infrastructure/kservebackend/v1alpha1.py new file mode 100644 index 000000000..a2f0281bf --- /dev/null +++ b/schemas/python/models/ai/modelplane/infrastructure/kservebackend/v1alpha1.py @@ -0,0 +1,200 @@ +# generated by datamodel-codegen: +# filename: workdir/infrastructure_modelplane_ai_v1alpha1_kservebackend.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, conint, constr + +from .....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class Listener(BaseModel): + name: constr(min_length=1, max_length=63) + """ + Unique listener name. + """ + port: conint(ge=1, le=65535) + """ + Port number for this listener. + """ + protocol: Literal['HTTP', 'TCP'] + """ + Protocol for this listener. + """ + + +class Gateway(BaseModel): + className: Optional[constr(min_length=1, max_length=63)] = 'envoy' + """ + GatewayClass name. Override if the cluster already has a GatewayClass named envoy. + """ + listeners: Optional[List[Listener]] = Field(None, max_length=8) + """ + Gateway listeners. Defaults to a single HTTP listener on port 80 if not specified. + """ + + +class Secret(BaseModel): + key: constr(max_length=253) + """ + Key within the Secret that holds the credential data. + """ + name: constr(max_length=253) + """ + Name of the Secret. + """ + type: Literal['Kubeconfig', 'GCPServiceAccountKey'] + """ + The type of credential this secret contains. Kubeconfig is required. Cloud-specific types are optional and determine how the ProviderConfigs authenticate. + """ + + +class Versions(BaseModel): + certManager: Optional[constr(min_length=1, max_length=32)] = 'v1.17.1' + """ + cert-manager chart version. + """ + envoyGateway: Optional[constr(min_length=1, max_length=32)] = 'v1.3.0' + """ + Envoy Gateway chart version. + """ + keda: Optional[constr(min_length=1, max_length=32)] = '2.17.1' + """ + KEDA chart version. + """ + kserve: Optional[constr(min_length=1, max_length=32)] = 'v0.16.0' + """ + KServe LLMInferenceService chart version. + """ + leaderWorkerSet: Optional[constr(min_length=1, max_length=32)] = 'v0.7.0' + """ + LeaderWorkerSet chart version. + """ + prometheus: Optional[constr(min_length=1, max_length=32)] = '72.6.2' + """ + kube-prometheus-stack chart version. + """ + + +class Spec(BaseModel): + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + gateway: Optional[Gateway] = None + """ + Configuration for the cluster's inference traffic gateway. + """ + secrets: List[Secret] = Field(..., min_length=1) + """ + Secrets used to authenticate to the target cluster. Typically sourced from a GKECluster's status.secrets. All secrets must be in the same namespace as this KServeBackend. A Kubeconfig secret is required. If a cloud-specific credential secret is present (e.g. GCPServiceAccountKey), the ProviderConfigs will use it for identity-based authentication instead of relying on the kubeconfig's embedded credentials. + """ + versions: Optional[Versions] = None + """ + Version pins for each component. Defaults are the latest tested combination. Override individual versions to upgrade components independently. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class GatewayModel(BaseModel): + address: Optional[constr(max_length=256)] = None + """ + The gateway's external address, once assigned by the cloud load balancer. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + gateway: Optional[GatewayModel] = None + """ + Status of the cluster's inference gateway. + """ + + +class KServeBackend(BaseModel): + apiVersion: Optional[Literal['infrastructure.modelplane.ai/v1alpha1']] = ( + 'infrastructure.modelplane.ai/v1alpha1' + ) + """ + 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[Literal['KServeBackend']] = 'KServeBackend' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + KServeBackendSpec defines the desired state of KServeBackend. + """ + status: Optional[Status] = None + """ + KServeBackendStatus defines the observed state of KServeBackend. + """ + + +class KServeBackendList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[KServeBackend] + """ + List of kservebackends. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/modeldeployment/__init__.py b/schemas/python/models/ai/modelplane/modeldeployment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py b/schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py new file mode 100644 index 000000000..9598b6366 --- /dev/null +++ b/schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py @@ -0,0 +1,222 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_modeldeployment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, conint, constr + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class ClusterSelector(BaseModel): + matchLabels: Optional[Dict[str, Any]] = None + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + + +class ConfigMapKeyRef(BaseModel): + key: str + name: str + optional: Optional[bool] = None + + +class SecretKeyRef(BaseModel): + key: str + name: str + optional: Optional[bool] = None + + +class ValueFrom(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + secretKeyRef: Optional[SecretKeyRef] = None + + +class EnvItem(BaseModel): + name: str + value: Optional[str] = None + valueFrom: Optional[ValueFrom] = None + + +class Container(BaseModel): + args: Optional[List[str]] = None + """ + Container args. For the engine container, these are passed through to the serving engine. Includes the model identifier (e.g. --model=...). + """ + env: Optional[List[EnvItem]] = None + """ + Environment variables. Supports valueFrom.secretKeyRef for secrets like HF_TOKEN. + """ + image: constr(min_length=1) + """ + Container image. + """ + name: constr(min_length=1) + """ + Container name. The container named "engine" is the inference engine. + """ + + +class ImagePullSecret(BaseModel): + name: str + + +class Spec(BaseModel): + containers: List[Container] = Field(..., min_length=1) + """ + Containers for the inference pod. The container named "engine" is the inference engine; additional containers pass through as sidecars. + """ + imagePullSecrets: Optional[List[ImagePullSecret]] = None + """ + Image pull secrets for private registries (NGC etc.). + """ + + +class Template(BaseModel): + metadata: Optional[Metadata] = None + """ + Metadata applied to inference pods. Useful for labels and annotations that control cluster-level features like service mesh injection. + """ + spec: Optional[Spec] = None + """ + Pod spec for inference workers. + """ + + +class Topology(BaseModel): + pipeline: Optional[conint(ge=1)] = 1 + """ + Nodes per worker. Defaults to 1 (single-node). Values greater than 1 enable multi-node serving via LeaderWorkerSet. + """ + tensor: conint(ge=1) + """ + GPUs per node. Required. + """ + + +class Workers(BaseModel): + count: Optional[conint(ge=1)] = 1 + """ + Number of workers per replica. Defaults to 1. + """ + template: Template + """ + Pod template for inference workers. A curated subset of PodTemplateSpec. + """ + topology: Topology + """ + Compute topology for one worker. The axes are independent and compose multiplicatively: GPUs per node = tensor, nodes per worker = pipeline. + """ + + +class SpecModel(BaseModel): + clusterSelector: Optional[ClusterSelector] = None + """ + Optional label selector to filter InferenceClusters. If omitted, all ready clusters are candidates. + """ + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + replicas: conint(ge=1, le=10) + """ + How many ModelReplicas to fan out to. Each replica is a complete serving instance scheduled to one InferenceCluster. + """ + workers: Workers + """ + Compute shape of one worker. Modelplane composes one worker (or workers.count workers) per ModelReplica. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Replicas(BaseModel): + ready: Optional[int] = None + total: Optional[int] = None + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + replicas: Optional[Replicas] = None + + +class ModelDeployment(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['ModelDeployment']] = 'ModelDeployment' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: SpecModel + status: Optional[Status] = None + + +class ModelDeploymentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ModelDeployment] + """ + List of modeldeployments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/modelendpoint/__init__.py b/schemas/python/models/ai/modelplane/modelendpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/modelendpoint/v1alpha1.py b/schemas/python/models/ai/modelplane/modelendpoint/v1alpha1.py new file mode 100644 index 000000000..7ae4255e7 --- /dev/null +++ b/schemas/python/models/ai/modelplane/modelendpoint/v1alpha1.py @@ -0,0 +1,120 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_modelendpoint.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, constr + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class Spec(BaseModel): + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + rewritePath: Optional[str] = None + """ + Path prefix that requests should be rewritten to when routed through this endpoint. Used by ModelService to configure URLRewrite on its HTTPRoute. For Modelplane- composed endpoints this is the LLMInferenceService path on the remote cluster, e.g. /default/qwen-demo/. + """ + url: constr(min_length=1) + """ + URL of the inference endpoint. Used to configure routing to this endpoint. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Routing(BaseModel): + backendName: Optional[str] = None + """ + Crossplane-generated name of the Backend resource composed by this endpoint. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + routing: Optional[Routing] = None + """ + Routing details for this endpoint. ModelService reads backendName to build HTTPRoute backendRefs. + """ + + +class ModelEndpoint(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['ModelEndpoint']] = 'ModelEndpoint' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + status: Optional[Status] = None + + +class ModelEndpointList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ModelEndpoint] + """ + List of modelendpoints. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/modelreplica/__init__.py b/schemas/python/models/ai/modelplane/modelreplica/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py b/schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py new file mode 100644 index 000000000..aede90b29 --- /dev/null +++ b/schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py @@ -0,0 +1,170 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_modelreplica.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, conint, constr + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class InferenceClusterRef(BaseModel): + name: str + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + + +class ConfigMapKeyRef(BaseModel): + key: str + name: str + optional: Optional[bool] = None + + +class SecretKeyRef(BaseModel): + key: str + name: str + optional: Optional[bool] = None + + +class ValueFrom(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + secretKeyRef: Optional[SecretKeyRef] = None + + +class EnvItem(BaseModel): + name: str + value: Optional[str] = None + valueFrom: Optional[ValueFrom] = None + + +class Container(BaseModel): + args: Optional[List[str]] = None + env: Optional[List[EnvItem]] = None + image: constr(min_length=1) + name: constr(min_length=1) + + +class ImagePullSecret(BaseModel): + name: str + + +class Spec(BaseModel): + containers: List[Container] = Field(..., min_length=1) + imagePullSecrets: Optional[List[ImagePullSecret]] = None + + +class Template(BaseModel): + metadata: Optional[Metadata] = None + spec: Optional[Spec] = None + + +class Topology(BaseModel): + pipeline: Optional[conint(ge=1)] = 1 + tensor: conint(ge=1) + + +class Workers(BaseModel): + count: Optional[conint(ge=1)] = 1 + template: Template + topology: Topology + + +class SpecModel(BaseModel): + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + inferenceClusterRef: InferenceClusterRef + """ + Reference to the InferenceCluster this replica targets. + """ + workers: Workers + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class ModelReplica(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['ModelReplica']] = 'ModelReplica' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: SpecModel + status: Optional[Status] = None + + +class ModelReplicaList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ModelReplica] + """ + List of modelreplicas. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/modelservice/__init__.py b/schemas/python/models/ai/modelplane/modelservice/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/modelservice/v1alpha1.py b/schemas/python/models/ai/modelplane/modelservice/v1alpha1.py new file mode 100644 index 000000000..17852a019 --- /dev/null +++ b/schemas/python/models/ai/modelplane/modelservice/v1alpha1.py @@ -0,0 +1,117 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_modelservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class Selector(BaseModel): + matchLabels: Dict[str, Any] + + +class Endpoint(BaseModel): + selector: Selector + + +class Spec(BaseModel): + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + endpoints: List[Endpoint] = Field(..., min_length=1) + """ + Endpoints to route traffic to. Each entry selects a set of ModelEndpoints by label. Matched endpoints are load-balanced equally. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Status(BaseModel): + address: Optional[str] = None + """ + Public address where this service is reachable. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class ModelService(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['ModelService']] = 'ModelService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + status: Optional[Status] = None + + +class ModelServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ModelService] + """ + List of modelservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/__init__.py b/schemas/python/models/io/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/__init__.py b/schemas/python/models/io/crossplane/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/__init__.py b/schemas/python/models/io/crossplane/apiextensions/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/__init__.py b/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v1.py b/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v1.py new file mode 100644 index 000000000..59a4de069 --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v1.py @@ -0,0 +1,555 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1_compositeresourcedefinition.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, constr + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ClaimNames(BaseModel): + categories: Optional[List[str]] = None + """ + categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). + This is published in API discovery documents, and used by clients to support invocations like + `kubectl get all`. + """ + kind: str + """ + kind is the serialized kind of the resource. It is normally CamelCase and singular. + Custom resource instances will use this value as the `kind` attribute in API calls. + """ + listKind: Optional[str] = None + """ + listKind is the serialized kind of the list for this resource. Defaults to "`kind`List". + """ + plural: str + """ + plural is the plural name of the resource to serve. + The custom resources are served under `/apis///.../`. + Must match the name of the CustomResourceDefinition (in the form `.`). + Must be all lowercase. + """ + shortNames: Optional[List[str]] = None + """ + shortNames are short names for the resource, exposed in API discovery documents, + and used by clients to support invocations like `kubectl get `. + It must be all lowercase. + """ + singular: Optional[str] = None + """ + singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. + """ + + +class Service(BaseModel): + name: str + """ + name is the name of the service. + Required + """ + namespace: str + """ + namespace is the namespace of the service. + Required + """ + path: Optional[str] = None + """ + path is an optional URL path at which the webhook will be contacted. + """ + port: Optional[int] = None + """ + port is an optional service port at which the webhook will be contacted. + `port` should be a valid port number (1-65535, inclusive). + Defaults to 443 for backward compatibility. + """ + + +class ClientConfig(BaseModel): + caBundle: Optional[str] = None + """ + caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. + If unspecified, system trust roots on the apiserver are used. + """ + service: Optional[Service] = None + """ + service is a reference to the service for this webhook. Either + service or url must be specified. + + If the webhook is running within the cluster, then you should use `service`. + """ + url: Optional[str] = None + """ + url gives the location of the webhook, in standard URL form + (`scheme://host:port/path`). Exactly one of `url` or `service` + must be specified. + + The `host` should not refer to a service running in the cluster; use + the `service` field instead. The host might be resolved via external + DNS in some apiservers (e.g., `kube-apiserver` cannot resolve + in-cluster DNS as that would be a layering violation). `host` may + also be an IP address. + + Please note that using `localhost` or `127.0.0.1` as a `host` is + risky unless you take great care to run this webhook on all hosts + which run an apiserver which might need to make calls to this + webhook. Such installs are likely to be non-portable, i.e., not easy + to turn up in a new cluster. + + The scheme must be "https"; the URL must begin with "https://". + + A path is optional, and if present may be any string permissible in + a URL. You may use the path to pass an arbitrary string to the + webhook, for example, a cluster identifier. + + Attempting to use a user or basic auth e.g. "user:password@" is not + allowed. Fragments ("#...") and query parameters ("?...") are not + allowed, either. + """ + + +class Webhook(BaseModel): + clientConfig: Optional[ClientConfig] = None + """ + clientConfig is the instructions for how to call the webhook if strategy is `Webhook`. + """ + conversionReviewVersions: List[str] + """ + conversionReviewVersions is an ordered list of preferred `ConversionReview` + versions the Webhook expects. The API server will use the first version in + the list which it supports. If none of the versions specified in this list + are supported by API server, conversion will fail for the custom resource. + If a persisted Webhook configuration specifies allowed versions and does not + include any versions known to the API Server, calls to the webhook will fail. + """ + + +class Conversion(BaseModel): + strategy: str + """ + strategy specifies how custom resources are converted between versions. Allowed values are: + - `"None"`: The converter only change the apiVersion and would not touch any other field in the custom resource. + - `"Webhook"`: API Server will call to an external webhook to do the conversion. Additional information + is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set. + """ + webhook: Optional[Webhook] = None + """ + webhook describes how to call the conversion webhook. Required when `strategy` is set to `"Webhook"`. + """ + + +class DefaultCompositionRef(BaseModel): + name: str + """ + Name of the Composition. + """ + + +class MatchExpression(BaseModel): + key: str + """ + key is the label key that the selector applies to. + """ + operator: str + """ + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + """ + values: Optional[List[str]] = None + """ + 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 DefaultCompositionRevisionSelector(BaseModel): + matchExpressions: Optional[List[MatchExpression]] = None + """ + matchExpressions is a list of label selector requirements. The requirements are ANDed. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + 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 EnforcedCompositionRef(BaseModel): + name: str + """ + Name of the Composition. + """ + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations + """ + labels: Optional[Dict[str, str]] = None + """ + Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + and services. + These labels are added to the composite resource and claim CRD's in addition + to any labels defined by `CompositionResourceDefinition` `metadata.labels`. + """ + + +class Names(BaseModel): + categories: Optional[List[str]] = None + """ + categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). + This is published in API discovery documents, and used by clients to support invocations like + `kubectl get all`. + """ + kind: str + """ + kind is the serialized kind of the resource. It is normally CamelCase and singular. + Custom resource instances will use this value as the `kind` attribute in API calls. + """ + listKind: Optional[str] = None + """ + listKind is the serialized kind of the list for this resource. Defaults to "`kind`List". + """ + plural: str + """ + plural is the plural name of the resource to serve. + The custom resources are served under `/apis///.../`. + Must match the name of the CustomResourceDefinition (in the form `.`). + Must be all lowercase. + """ + shortNames: Optional[List[str]] = None + """ + shortNames are short names for the resource, exposed in API discovery documents, + and used by clients to support invocations like `kubectl get `. + It must be all lowercase. + """ + singular: Optional[str] = None + """ + singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. + """ + + +class AdditionalPrinterColumn(BaseModel): + description: Optional[str] = None + """ + description is a human readable description of this column. + """ + format: Optional[str] = None + """ + format is an optional OpenAPI type definition for this column. The 'name' format is applied + to the primary identifier column to assist in clients identifying column is the resource name. + See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. + """ + jsonPath: str + """ + jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against + each custom resource to produce the value for this column. + """ + name: str + """ + name is a human readable name for the column. + """ + priority: Optional[int] = None + """ + priority is an integer defining the relative importance of this column compared to others. Lower + numbers are considered higher priority. Columns that may be omitted in limited space scenarios + should be given a priority greater than 0. + """ + type: str + """ + type is an OpenAPI type definition for this column. + See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. + """ + + +class Schema(BaseModel): + openAPIV3Schema: Optional[Dict[str, Any]] = None + """ + OpenAPIV3Schema is the OpenAPI v3 schema to use for validation and + pruning. + """ + + +class Version(BaseModel): + additionalPrinterColumns: Optional[List[AdditionalPrinterColumn]] = None + """ + AdditionalPrinterColumns specifies additional columns returned in Table + output. If no columns are specified, a single column displaying the age + of the custom resource is used. See the following link for details: + https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables + """ + deprecated: Optional[bool] = None + """ + The deprecated field specifies that this version is deprecated and should + not be used. + """ + deprecationWarning: Optional[constr(max_length=256)] = None + """ + DeprecationWarning specifies the message that should be shown to the user + when using this version. + """ + name: str + """ + Name of this version, e.g. “v1”, “v2beta1”, etc. Composite resources are + served under this version at `/apis///...` if `served` is + true. + """ + referenceable: bool + """ + Referenceable specifies that this version may be referenced by a + Composition in order to configure which resources an XR may be composed + of. Exactly one version must be marked as referenceable; all Compositions + must target only the referenceable version. The referenceable version + must be served. It's mapped to the CRD's `spec.versions[*].storage` field. + """ + schema_: Optional[Schema] = Field(None, alias='schema') + """ + Schema describes the schema used for validation, pruning, and defaulting + of this version of the defined composite resource. Fields required by all + composite resources will be injected into this schema automatically, and + will override equivalently named fields in this schema. Omitting this + schema results in a schema that contains only the fields required by all + composite resources. + """ + served: bool + """ + Served specifies that this version should be served via REST APIs. + """ + + +class Spec(BaseModel): + claimNames: Optional[ClaimNames] = None + """ + ClaimNames specifies the names of an optional composite resource claim. + When claim names are specified Crossplane will create a namespaced + 'composite resource claim' CRD that corresponds to the defined composite + resource. This composite resource claim acts as a namespaced proxy for + the composite resource; creating, updating, or deleting the claim will + create, update, or delete a corresponding composite resource. You may add + claim names to an existing CompositeResourceDefinition, but they cannot + be changed or removed once they have been set. + """ + connectionSecretKeys: Optional[List[str]] = None + """ + ConnectionSecretKeys is the list of connection secret keys the + defined XR can publish. If the list is empty, all keys will be + published. If the list isn't empty, any connection secret keys that + don't appear in the list will be filtered out. Only LegacyCluster XRs + support connection secrets. + """ + conversion: Optional[Conversion] = None + """ + Conversion defines all conversion settings for the defined Composite resource. + """ + defaultCompositeDeletePolicy: Optional[Literal['Background', 'Foreground']] = ( + 'Background' + ) + """ + DefaultCompositeDeletePolicy is the policy used when deleting the Composite + that is associated with the Claim if no policy has been specified. + """ + defaultCompositionRef: Optional[DefaultCompositionRef] = None + """ + DefaultCompositionRef refers to the Composition resource that will be used + in case no composition selector is given. + """ + defaultCompositionRevisionSelector: Optional[DefaultCompositionRevisionSelector] = ( + None + ) + """ + DefaultCompositionRevisionSelector refers to the CompositionRevision that will be used + in case no compositionRevision selector is given. + """ + defaultCompositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = ( + 'Automatic' + ) + """ + DefaultCompositionUpdatePolicy is the policy used when updating composites after a new + Composition Revision has been created if no policy has been specified on the composite. + """ + enforcedCompositionRef: Optional[EnforcedCompositionRef] = None + """ + EnforcedCompositionRef refers to the Composition resource that will be used + by all composite instances whose schema is defined by this definition. + """ + group: str + """ + Group specifies the API group of the defined composite resource. + Composite resources are served under `/apis//...`. Must match the + name of the XRD (in the form `.`). + """ + metadata: Optional[Metadata] = None + """ + Metadata specifies the desired metadata for the defined composite resource and claim CRD's. + """ + names: Names + """ + Names specifies the resource and kind names of the defined composite + resource. + """ + scope: Optional[Literal['LegacyCluster', 'Namespaced', 'Cluster']] = 'LegacyCluster' + """ + Scope of the defined composite resource. Namespaced composite resources + are scoped to a single namespace. Cluster scoped composite resource exist + outside the scope of any namespace. Neither can be claimed. Legacy + cluster scoped composite resources are cluster scoped resources that can + be claimed. + """ + versions: List[Version] + """ + Versions is the list of all API versions of the defined composite + resource. Version names are used to compute the order in which served + versions are listed in API discovery. If the version string is + "kube-like", it will sort above non "kube-like" version strings, which + are ordered lexicographically. "Kube-like" versions start with a "v", + then are followed by a number (the major version), then optionally the + string "alpha" or "beta" and another number (the minor version). These + are sorted first by GA > beta > alpha (where GA is a version with no + suffix such as beta or alpha), and then by comparing major version, then + minor version. An example sorted list of versions: v10, v2, v1, v11beta2, + v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class CompositeResourceClaimType(BaseModel): + apiVersion: str + """ + APIVersion of the type. + """ + kind: str + """ + Kind of the type. + """ + + +class CompositeResourceType(BaseModel): + apiVersion: str + """ + APIVersion of the type. + """ + kind: str + """ + Kind of the type. + """ + + +class Controllers(BaseModel): + compositeResourceClaimType: Optional[CompositeResourceClaimType] = None + """ + The CompositeResourceClaimTypeRef is the type of composite resource claim + that Crossplane is currently reconciling for this definition. Its version + will eventually become consistent with the definition's referenceable + version. Note that clients may interact with any served type; this is + simply the type that Crossplane interacts with. + """ + compositeResourceType: Optional[CompositeResourceType] = None + """ + The CompositeResourceTypeRef is the type of composite resource that + Crossplane is currently reconciling for this definition. Its version will + eventually become consistent with the definition's referenceable version. + Note that clients may interact with any served type; this is simply the + type that Crossplane interacts with. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + controllers: Optional[Controllers] = None + """ + Controllers represents the status of the controllers that power this + composite resource definition. + """ + + +class CompositeResourceDefinition(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1']] = ( + 'apiextensions.crossplane.io/v1' + ) + """ + 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[Literal['CompositeResourceDefinition']] = ( + 'CompositeResourceDefinition' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + CompositeResourceDefinitionSpec specifies the desired state of the definition. + """ + status: Optional[Status] = None + """ + CompositeResourceDefinitionStatus shows the observed state of the definition. + """ + + +class CompositeResourceDefinitionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[CompositeResourceDefinition] + """ + List of compositeresourcedefinitions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v2.py b/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v2.py new file mode 100644 index 000000000..7c01e90dc --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/compositeresourcedefinition/v2.py @@ -0,0 +1,558 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v2_compositeresourcedefinition.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, constr + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ClaimNames(BaseModel): + categories: Optional[List[str]] = None + """ + categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). + This is published in API discovery documents, and used by clients to support invocations like + `kubectl get all`. + """ + kind: str + """ + kind is the serialized kind of the resource. It is normally CamelCase and singular. + Custom resource instances will use this value as the `kind` attribute in API calls. + """ + listKind: Optional[str] = None + """ + listKind is the serialized kind of the list for this resource. Defaults to "`kind`List". + """ + plural: str + """ + plural is the plural name of the resource to serve. + The custom resources are served under `/apis///.../`. + Must match the name of the CustomResourceDefinition (in the form `.`). + Must be all lowercase. + """ + shortNames: Optional[List[str]] = None + """ + shortNames are short names for the resource, exposed in API discovery documents, + and used by clients to support invocations like `kubectl get `. + It must be all lowercase. + """ + singular: Optional[str] = None + """ + singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. + """ + + +class Service(BaseModel): + name: str + """ + name is the name of the service. + Required + """ + namespace: str + """ + namespace is the namespace of the service. + Required + """ + path: Optional[str] = None + """ + path is an optional URL path at which the webhook will be contacted. + """ + port: Optional[int] = None + """ + port is an optional service port at which the webhook will be contacted. + `port` should be a valid port number (1-65535, inclusive). + Defaults to 443 for backward compatibility. + """ + + +class ClientConfig(BaseModel): + caBundle: Optional[str] = None + """ + caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. + If unspecified, system trust roots on the apiserver are used. + """ + service: Optional[Service] = None + """ + service is a reference to the service for this webhook. Either + service or url must be specified. + + If the webhook is running within the cluster, then you should use `service`. + """ + url: Optional[str] = None + """ + url gives the location of the webhook, in standard URL form + (`scheme://host:port/path`). Exactly one of `url` or `service` + must be specified. + + The `host` should not refer to a service running in the cluster; use + the `service` field instead. The host might be resolved via external + DNS in some apiservers (e.g., `kube-apiserver` cannot resolve + in-cluster DNS as that would be a layering violation). `host` may + also be an IP address. + + Please note that using `localhost` or `127.0.0.1` as a `host` is + risky unless you take great care to run this webhook on all hosts + which run an apiserver which might need to make calls to this + webhook. Such installs are likely to be non-portable, i.e., not easy + to turn up in a new cluster. + + The scheme must be "https"; the URL must begin with "https://". + + A path is optional, and if present may be any string permissible in + a URL. You may use the path to pass an arbitrary string to the + webhook, for example, a cluster identifier. + + Attempting to use a user or basic auth e.g. "user:password@" is not + allowed. Fragments ("#...") and query parameters ("?...") are not + allowed, either. + """ + + +class Webhook(BaseModel): + clientConfig: Optional[ClientConfig] = None + """ + clientConfig is the instructions for how to call the webhook if strategy is `Webhook`. + """ + conversionReviewVersions: List[str] + """ + conversionReviewVersions is an ordered list of preferred `ConversionReview` + versions the Webhook expects. The API server will use the first version in + the list which it supports. If none of the versions specified in this list + are supported by API server, conversion will fail for the custom resource. + If a persisted Webhook configuration specifies allowed versions and does not + include any versions known to the API Server, calls to the webhook will fail. + """ + + +class Conversion(BaseModel): + strategy: str + """ + strategy specifies how custom resources are converted between versions. Allowed values are: + - `"None"`: The converter only change the apiVersion and would not touch any other field in the custom resource. + - `"Webhook"`: API Server will call to an external webhook to do the conversion. Additional information + is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set. + """ + webhook: Optional[Webhook] = None + """ + webhook describes how to call the conversion webhook. Required when `strategy` is set to `"Webhook"`. + """ + + +class DefaultCompositionRef(BaseModel): + name: str + """ + Name of the Composition. + """ + + +class MatchExpression(BaseModel): + key: str + """ + key is the label key that the selector applies to. + """ + operator: str + """ + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + """ + values: Optional[List[str]] = None + """ + 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 DefaultCompositionRevisionSelector(BaseModel): + matchExpressions: Optional[List[MatchExpression]] = None + """ + matchExpressions is a list of label selector requirements. The requirements are ANDed. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + 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 EnforcedCompositionRef(BaseModel): + name: str + """ + Name of the Composition. + """ + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations + """ + labels: Optional[Dict[str, str]] = None + """ + Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + and services. + These labels are added to the composite resource and claim CRD's in addition + to any labels defined by `CompositionResourceDefinition` `metadata.labels`. + """ + + +class Names(BaseModel): + categories: Optional[List[str]] = None + """ + categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). + This is published in API discovery documents, and used by clients to support invocations like + `kubectl get all`. + """ + kind: str + """ + kind is the serialized kind of the resource. It is normally CamelCase and singular. + Custom resource instances will use this value as the `kind` attribute in API calls. + """ + listKind: Optional[str] = None + """ + listKind is the serialized kind of the list for this resource. Defaults to "`kind`List". + """ + plural: str + """ + plural is the plural name of the resource to serve. + The custom resources are served under `/apis///.../`. + Must match the name of the CustomResourceDefinition (in the form `.`). + Must be all lowercase. + """ + shortNames: Optional[List[str]] = None + """ + shortNames are short names for the resource, exposed in API discovery documents, + and used by clients to support invocations like `kubectl get `. + It must be all lowercase. + """ + singular: Optional[str] = None + """ + singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. + """ + + +class AdditionalPrinterColumn(BaseModel): + description: Optional[str] = None + """ + description is a human readable description of this column. + """ + format: Optional[str] = None + """ + format is an optional OpenAPI type definition for this column. The 'name' format is applied + to the primary identifier column to assist in clients identifying column is the resource name. + See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. + """ + jsonPath: str + """ + jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against + each custom resource to produce the value for this column. + """ + name: str + """ + name is a human readable name for the column. + """ + priority: Optional[int] = None + """ + priority is an integer defining the relative importance of this column compared to others. Lower + numbers are considered higher priority. Columns that may be omitted in limited space scenarios + should be given a priority greater than 0. + """ + type: str + """ + type is an OpenAPI type definition for this column. + See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. + """ + + +class Schema(BaseModel): + openAPIV3Schema: Optional[Dict[str, Any]] = None + """ + OpenAPIV3Schema is the OpenAPI v3 schema to use for validation and + pruning. + """ + + +class Version(BaseModel): + additionalPrinterColumns: Optional[List[AdditionalPrinterColumn]] = None + """ + AdditionalPrinterColumns specifies additional columns returned in Table + output. If no columns are specified, a single column displaying the age + of the custom resource is used. See the following link for details: + https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables + """ + deprecated: Optional[bool] = None + """ + The deprecated field specifies that this version is deprecated and should + not be used. + """ + deprecationWarning: Optional[constr(max_length=256)] = None + """ + DeprecationWarning specifies the message that should be shown to the user + when using this version. + """ + name: str + """ + Name of this version, e.g. “v1”, “v2beta1”, etc. Composite resources are + served under this version at `/apis///...` if `served` is + true. + """ + referenceable: bool + """ + Referenceable specifies that this version may be referenced by a + Composition in order to configure which resources an XR may be composed + of. Exactly one version must be marked as referenceable; all Compositions + must target only the referenceable version. The referenceable version + must be served. It's mapped to the CRD's `spec.versions[*].storage` field. + """ + schema_: Optional[Schema] = Field(None, alias='schema') + """ + Schema describes the schema used for validation, pruning, and defaulting + of this version of the defined composite resource. Fields required by all + composite resources will be injected into this schema automatically, and + will override equivalently named fields in this schema. Omitting this + schema results in a schema that contains only the fields required by all + composite resources. + """ + served: bool + """ + Served specifies that this version should be served via REST APIs. + """ + + +class Spec(BaseModel): + claimNames: Optional[ClaimNames] = None + """ + ClaimNames specifies the names of an optional composite resource claim. + When claim names are specified Crossplane will create a namespaced + 'composite resource claim' CRD that corresponds to the defined composite + resource. This composite resource claim acts as a namespaced proxy for + the composite resource; creating, updating, or deleting the claim will + create, update, or delete a corresponding composite resource. You may add + claim names to an existing CompositeResourceDefinition, but they cannot + be changed or removed once they have been set. + + Deprecated: Claims aren't supported in apiextensions.crossplane.io/v2. + """ + connectionSecretKeys: Optional[List[str]] = None + """ + ConnectionSecretKeys is the list of connection secret keys the + defined XR can publish. If the list is empty, all keys will be + published. If the list isn't empty, any connection secret keys that + don't appear in the list will be filtered out. Only LegacyCluster XRs + support connection secrets. + + Deprecated: XR connection secrets aren't supported in + apiextensions.crossplane.io/v2. Compose a secret instead. + """ + conversion: Optional[Conversion] = None + """ + Conversion defines all conversion settings for the defined Composite resource. + """ + defaultCompositeDeletePolicy: Optional[Literal['Background', 'Foreground']] = None + """ + DefaultCompositeDeletePolicy is the policy used when deleting the Composite + that is associated with the Claim if no policy has been specified. + + Deprecated: Claims aren't supported in apiextensions.crossplane.io/v2. + """ + defaultCompositionRef: Optional[DefaultCompositionRef] = None + """ + DefaultCompositionRef refers to the Composition resource that will be used + in case no composition selector is given. + """ + defaultCompositionRevisionSelector: Optional[DefaultCompositionRevisionSelector] = ( + None + ) + """ + DefaultCompositionRevisionSelector refers to the CompositionRevision that will be used + in case no compositionRevision selector is given. + """ + defaultCompositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = ( + 'Automatic' + ) + """ + DefaultCompositionUpdatePolicy is the policy used when updating composites after a new + Composition Revision has been created if no policy has been specified on the composite. + """ + enforcedCompositionRef: Optional[EnforcedCompositionRef] = None + """ + EnforcedCompositionRef refers to the Composition resource that will be used + by all composite instances whose schema is defined by this definition. + """ + group: str + """ + Group specifies the API group of the defined composite resource. + Composite resources are served under `/apis//...`. Must match the + name of the XRD (in the form `.`). + """ + metadata: Optional[Metadata] = None + """ + Metadata specifies the desired metadata for the defined composite resource and claim CRD's. + """ + names: Names + """ + Names specifies the resource and kind names of the defined composite + resource. + """ + scope: Optional[Literal['Namespaced', 'Cluster']] = 'Namespaced' + """ + Scope of the defined composite resource. Namespaced composite resources + are scoped to a single namespace. Cluster scoped composite resource exist + outside the scope of any namespace. + """ + versions: List[Version] + """ + Versions is the list of all API versions of the defined composite + resource. Version names are used to compute the order in which served + versions are listed in API discovery. If the version string is + "kube-like", it will sort above non "kube-like" version strings, which + are ordered lexicographically. "Kube-like" versions start with a "v", + then are followed by a number (the major version), then optionally the + string "alpha" or "beta" and another number (the minor version). These + are sorted first by GA > beta > alpha (where GA is a version with no + suffix such as beta or alpha), and then by comparing major version, then + minor version. An example sorted list of versions: v10, v2, v1, v11beta2, + v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class CompositeResourceClaimType(BaseModel): + apiVersion: str + """ + APIVersion of the type. + """ + kind: str + """ + Kind of the type. + """ + + +class CompositeResourceType(BaseModel): + apiVersion: str + """ + APIVersion of the type. + """ + kind: str + """ + Kind of the type. + """ + + +class Controllers(BaseModel): + compositeResourceClaimType: Optional[CompositeResourceClaimType] = None + """ + The CompositeResourceClaimTypeRef is the type of composite resource claim + that Crossplane is currently reconciling for this definition. Its version + will eventually become consistent with the definition's referenceable + version. Note that clients may interact with any served type; this is + simply the type that Crossplane interacts with. + """ + compositeResourceType: Optional[CompositeResourceType] = None + """ + The CompositeResourceTypeRef is the type of composite resource that + Crossplane is currently reconciling for this definition. Its version will + eventually become consistent with the definition's referenceable version. + Note that clients may interact with any served type; this is simply the + type that Crossplane interacts with. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + controllers: Optional[Controllers] = None + """ + Controllers represents the status of the controllers that power this + composite resource definition. + """ + + +class CompositeResourceDefinition(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v2']] = ( + 'apiextensions.crossplane.io/v2' + ) + """ + 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[Literal['CompositeResourceDefinition']] = ( + 'CompositeResourceDefinition' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + CompositeResourceDefinitionSpec specifies the desired state of the definition. + """ + status: Optional[Status] = None + """ + CompositeResourceDefinitionStatus shows the observed state of the definition. + """ + + +class CompositeResourceDefinitionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[CompositeResourceDefinition] + """ + List of compositeresourcedefinitions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/composition/__init__.py b/schemas/python/models/io/crossplane/apiextensions/composition/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/composition/v1.py b/schemas/python/models/io/crossplane/apiextensions/composition/v1.py new file mode 100644 index 000000000..190caf850 --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/composition/v1.py @@ -0,0 +1,213 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1_composition.yaml + +from __future__ import annotations + +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositeTypeRef(BaseModel): + apiVersion: str + """ + APIVersion of the type. + """ + kind: str + """ + Kind of the type. + """ + + +class SecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credential(BaseModel): + name: str + """ + Name of this set of credentials. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret containing credentials that should + be supplied to the function. + """ + source: Literal['None', 'Secret'] + """ + Source of the function credentials. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced Function. + """ + + +class RequiredResource(BaseModel): + apiVersion: str + """ + APIVersion of the required resource. + """ + kind: str + """ + Kind of the required resource. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels specifies the set of labels to match for finding the + required resource. When specified, Name is ignored. + """ + name: Optional[str] = None + """ + Name of the required resource. + """ + namespace: Optional[str] = None + """ + Namespace of the required resource if it is namespaced. + """ + requirementName: str + """ + RequirementName is the unique name to identify this required resource + in the Required Resources map in the function request. + """ + + +class RequiredSchema(BaseModel): + apiVersion: str + """ + APIVersion of the resource kind whose schema is required, e.g. "example.org/v1". + """ + kind: str + """ + Kind of resource whose schema is required, e.g. "MyResource". + """ + requirementName: str + """ + RequirementName is the unique name to identify this required schema + in the Required Schemas map in the function request. + """ + + +class Requirements(BaseModel): + requiredResources: Optional[List[RequiredResource]] = None + """ + RequiredResources is a list of resources that must be fetched before + this function is called. + """ + requiredSchemas: Optional[List[RequiredSchema]] = None + """ + RequiredSchemas is a list of OpenAPI schemas that must be fetched before + this function is called. + """ + + +class PipelineItem(BaseModel): + credentials: Optional[List[Credential]] = None + """ + Credentials are optional credentials that the function needs. + """ + functionRef: FunctionRef + """ + FunctionRef is a reference to the function this step should + execute. + """ + input: Optional[Dict[str, Any]] = None + """ + Input is an optional, arbitrary Kubernetes resource (i.e. a resource + with an apiVersion and kind) that will be passed to the function as + the 'input' of its RunFunctionRequest. + """ + requirements: Optional[Requirements] = None + """ + Requirements are resource requirements that will be satisfied before + this pipeline step is called for the first time. This allows + pre-populating required resources without requiring a function to + request them first. + """ + step: str + """ + Step name. Must be unique within its Pipeline. + """ + + +class Spec(BaseModel): + compositeTypeRef: CompositeTypeRef + """ + CompositeTypeRef specifies the type of composite resource that this + composition is compatible with. + """ + mode: Optional[Literal['Pipeline']] = 'Pipeline' + """ + Mode controls what type or "mode" of Composition will be used. + + "Pipeline" indicates that a Composition specifies a pipeline of + functions, each of which is responsible for producing composed + resources that Crossplane should create or update. + """ + pipeline: Optional[List[PipelineItem]] = Field(None, max_length=99, min_length=1) + """ + Pipeline is a list of composition function steps that will be used when a + composite resource referring to this composition is created. One of + resources and pipeline must be specified - you cannot specify both. + + The Pipeline is only used by the "Pipeline" mode of Composition. It is + ignored by other modes. + """ + writeConnectionSecretsToNamespace: Optional[str] = None + """ + WriteConnectionSecretsToNamespace specifies the namespace in which the + connection secrets of composite resource dynamically provisioned using + this composition will be created. + """ + + +class Composition(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1']] = ( + 'apiextensions.crossplane.io/v1' + ) + """ + 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[Literal['Composition']] = 'Composition' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + CompositionSpec specifies desired state of a composition. + """ + + +class CompositionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Composition] + """ + List of compositions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/compositionrevision/__init__.py b/schemas/python/models/io/crossplane/apiextensions/compositionrevision/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/compositionrevision/v1.py b/schemas/python/models/io/crossplane/apiextensions/compositionrevision/v1.py new file mode 100644 index 000000000..5fc53f685 --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/compositionrevision/v1.py @@ -0,0 +1,267 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1_compositionrevision.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class CompositeTypeRef(BaseModel): + apiVersion: str + """ + APIVersion of the type. + """ + kind: str + """ + Kind of the type. + """ + + +class SecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credential(BaseModel): + name: str + """ + Name of this set of credentials. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret containing credentials that should + be supplied to the function. + """ + source: Literal['None', 'Secret'] + """ + Source of the function credentials. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced Function. + """ + + +class RequiredResource(BaseModel): + apiVersion: str + """ + APIVersion of the required resource. + """ + kind: str + """ + Kind of the required resource. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels specifies the set of labels to match for finding the + required resource. When specified, Name is ignored. + """ + name: Optional[str] = None + """ + Name of the required resource. + """ + namespace: Optional[str] = None + """ + Namespace of the required resource if it is namespaced. + """ + requirementName: str + """ + RequirementName is the unique name to identify this required resource + in the Required Resources map in the function request. + """ + + +class RequiredSchema(BaseModel): + apiVersion: str + """ + APIVersion of the resource kind whose schema is required, e.g. "example.org/v1". + """ + kind: str + """ + Kind of resource whose schema is required, e.g. "MyResource". + """ + requirementName: str + """ + RequirementName is the unique name to identify this required schema + in the Required Schemas map in the function request. + """ + + +class Requirements(BaseModel): + requiredResources: Optional[List[RequiredResource]] = None + """ + RequiredResources is a list of resources that must be fetched before + this function is called. + """ + requiredSchemas: Optional[List[RequiredSchema]] = None + """ + RequiredSchemas is a list of OpenAPI schemas that must be fetched before + this function is called. + """ + + +class PipelineItem(BaseModel): + credentials: Optional[List[Credential]] = None + """ + Credentials are optional credentials that the function needs. + """ + functionRef: FunctionRef + """ + FunctionRef is a reference to the function this step should + execute. + """ + input: Optional[Dict[str, Any]] = None + """ + Input is an optional, arbitrary Kubernetes resource (i.e. a resource + with an apiVersion and kind) that will be passed to the function as + the 'input' of its RunFunctionRequest. + """ + requirements: Optional[Requirements] = None + """ + Requirements are resource requirements that will be satisfied before + this pipeline step is called for the first time. This allows + pre-populating required resources without requiring a function to + request them first. + """ + step: str + """ + Step name. Must be unique within its Pipeline. + """ + + +class Spec(BaseModel): + compositeTypeRef: CompositeTypeRef + """ + CompositeTypeRef specifies the type of composite resource that this + composition is compatible with. + """ + mode: Optional[Literal['Pipeline']] = 'Pipeline' + """ + Mode controls what type or "mode" of Composition will be used. + + "Pipeline" indicates that a Composition specifies a pipeline of + functions, each of which is responsible for producing composed + resources that Crossplane should create or update. + """ + pipeline: Optional[List[PipelineItem]] = None + """ + Pipeline is a list of function steps that will be used when a + composite resource referring to this composition is created. + + The Pipeline is only used by the "Pipeline" mode of Composition. It is + ignored by other modes. + """ + revision: int + """ + Revision number. Newer revisions have larger numbers. + + This number can change. When a Composition transitions from state A + -> B -> A there will be only two CompositionRevisions. Crossplane will + edit the original CompositionRevision to change its revision number from + 0 to 2. + """ + writeConnectionSecretsToNamespace: Optional[str] = None + """ + WriteConnectionSecretsToNamespace specifies the namespace in which the + connection secrets of composite resource dynamically provisioned using + this composition will be created. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class CompositionRevision(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1']] = ( + 'apiextensions.crossplane.io/v1' + ) + """ + 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[Literal['CompositionRevision']] = 'CompositionRevision' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + CompositionRevisionSpec specifies the desired state of the composition + revision. + """ + status: Optional[Status] = None + """ + CompositionRevisionStatus shows the observed state of the composition + revision. + """ + + +class CompositionRevisionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[CompositionRevision] + """ + List of compositionrevisions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/environmentconfig/__init__.py b/schemas/python/models/io/crossplane/apiextensions/environmentconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/environmentconfig/v1beta1.py b/schemas/python/models/io/crossplane/apiextensions/environmentconfig/v1beta1.py new file mode 100644 index 000000000..6383c8704 --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/environmentconfig/v1beta1.py @@ -0,0 +1,51 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1beta1_environmentconfig.yaml + +from __future__ import annotations + +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class EnvironmentConfig(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1beta1']] = ( + 'apiextensions.crossplane.io/v1beta1' + ) + """ + 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 + """ + data: Optional[Dict[str, Any]] = None + """ + The data of this EnvironmentConfig. + This may contain any kind of structure that can be serialized into JSON. + """ + kind: Optional[Literal['EnvironmentConfig']] = 'EnvironmentConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + + +class EnvironmentConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[EnvironmentConfig] + """ + List of environmentconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/managedresourceactivationpolicy/__init__.py b/schemas/python/models/io/crossplane/apiextensions/managedresourceactivationpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/managedresourceactivationpolicy/v1alpha1.py b/schemas/python/models/io/crossplane/apiextensions/managedresourceactivationpolicy/v1alpha1.py new file mode 100644 index 000000000..8f01b954e --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/managedresourceactivationpolicy/v1alpha1.py @@ -0,0 +1,108 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1alpha1_managedresourceactivationpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Spec(BaseModel): + activate: List[str] = Field(..., min_length=1) + """ + Activations is an array of MRD names to activate. Supports wildcard + prefixes (like `*.aws.crossplane.io`) but not full regular expressions. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + activated: Optional[List[str]] = None + """ + Activated names the ManagedResourceDefinitions this policy has activated. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class ManagedResourceActivationPolicy(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1alpha1']] = ( + 'apiextensions.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ManagedResourceActivationPolicy']] = ( + 'ManagedResourceActivationPolicy' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + ManagedResourceActivationPolicySpec specifies the desired activation state of ManagedResourceDefinitions. + """ + status: Optional[Status] = None + """ + ManagedResourceActivationPolicyStatus shows the observed state of the policy. + """ + + +class ManagedResourceActivationPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ManagedResourceActivationPolicy] + """ + List of managedresourceactivationpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/managedresourcedefinition/__init__.py b/schemas/python/models/io/crossplane/apiextensions/managedresourcedefinition/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/managedresourcedefinition/v1alpha1.py b/schemas/python/models/io/crossplane/apiextensions/managedresourcedefinition/v1alpha1.py new file mode 100644 index 000000000..e19cfb87c --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/managedresourcedefinition/v1alpha1.py @@ -0,0 +1,434 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1alpha1_managedresourcedefinition.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConnectionDetail(BaseModel): + description: str + """ + Description of how the key is used. + """ + name: str + """ + Name of the key. + """ + + +class Service(BaseModel): + name: str + """ + name is the name of the service. + Required + """ + namespace: str + """ + namespace is the namespace of the service. + Required + """ + path: Optional[str] = None + """ + path is an optional URL path at which the webhook will be contacted. + """ + port: Optional[int] = None + """ + port is an optional service port at which the webhook will be contacted. + `port` should be a valid port number (1-65535, inclusive). + Defaults to 443 for backward compatibility. + """ + + +class ClientConfig(BaseModel): + caBundle: Optional[str] = None + """ + caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. + If unspecified, system trust roots on the apiserver are used. + """ + service: Optional[Service] = None + """ + service is a reference to the service for this webhook. Either + service or url must be specified. + + If the webhook is running within the cluster, then you should use `service`. + """ + url: Optional[str] = None + """ + url gives the location of the webhook, in standard URL form + (`scheme://host:port/path`). Exactly one of `url` or `service` + must be specified. + + The `host` should not refer to a service running in the cluster; use + the `service` field instead. The host might be resolved via external + DNS in some apiservers (e.g., `kube-apiserver` cannot resolve + in-cluster DNS as that would be a layering violation). `host` may + also be an IP address. + + Please note that using `localhost` or `127.0.0.1` as a `host` is + risky unless you take great care to run this webhook on all hosts + which run an apiserver which might need to make calls to this + webhook. Such installs are likely to be non-portable, i.e., not easy + to turn up in a new cluster. + + The scheme must be "https"; the URL must begin with "https://". + + A path is optional, and if present may be any string permissible in + a URL. You may use the path to pass an arbitrary string to the + webhook, for example, a cluster identifier. + + Attempting to use a user or basic auth e.g. "user:password@" is not + allowed. Fragments ("#...") and query parameters ("?...") are not + allowed, either. + """ + + +class Webhook(BaseModel): + clientConfig: Optional[ClientConfig] = None + """ + clientConfig is the instructions for how to call the webhook if strategy is `Webhook`. + """ + conversionReviewVersions: List[str] + """ + conversionReviewVersions is an ordered list of preferred `ConversionReview` + versions the Webhook expects. The API server will use the first version in + the list which it supports. If none of the versions specified in this list + are supported by API server, conversion will fail for the custom resource. + If a persisted Webhook configuration specifies allowed versions and does not + include any versions known to the API Server, calls to the webhook will fail. + """ + + +class Conversion(BaseModel): + strategy: str + """ + strategy specifies how custom resources are converted between versions. Allowed values are: + - `"None"`: The converter only change the apiVersion and would not touch any other field in the custom resource. + - `"Webhook"`: API Server will call to an external webhook to do the conversion. Additional information + is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set. + """ + webhook: Optional[Webhook] = None + """ + webhook describes how to call the conversion webhook. Required when `strategy` is set to `"Webhook"`. + """ + + +class Names(BaseModel): + categories: Optional[List[str]] = None + """ + categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). + This is published in API discovery documents, and used by clients to support invocations like + `kubectl get all`. + """ + kind: str + """ + kind is the serialized kind of the resource. It is normally CamelCase and singular. + Custom resource instances will use this value as the `kind` attribute in API calls. + """ + listKind: Optional[str] = None + """ + listKind is the serialized kind of the list for this resource. Defaults to "`kind`List". + """ + plural: str + """ + plural is the plural name of the resource to serve. + The custom resources are served under `/apis///.../`. + Must match the name of the CustomResourceDefinition (in the form `.`). + Must be all lowercase. + """ + shortNames: Optional[List[str]] = None + """ + shortNames are short names for the resource, exposed in API discovery documents, + and used by clients to support invocations like `kubectl get `. + It must be all lowercase. + """ + singular: Optional[str] = None + """ + singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. + """ + + +class AdditionalPrinterColumn(BaseModel): + description: Optional[str] = None + """ + description is a human readable description of this column. + """ + format: Optional[str] = None + """ + format is an optional OpenAPI type definition for this column. The 'name' format is applied + to the primary identifier column to assist in clients identifying column is the resource name. + See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. + """ + jsonPath: str + """ + jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against + each custom resource to produce the value for this column. + """ + name: str + """ + name is a human readable name for the column. + """ + priority: Optional[int] = None + """ + priority is an integer defining the relative importance of this column compared to others. Lower + numbers are considered higher priority. Columns that may be omitted in limited space scenarios + should be given a priority greater than 0. + """ + type: str + """ + type is an OpenAPI type definition for this column. + See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. + """ + + +class Schema(BaseModel): + openAPIV3Schema: Optional[Dict[str, Any]] = None + """ + OpenAPIV3Schema is the OpenAPI v3 schema to use for validation and + pruning. + """ + + +class SelectableField(BaseModel): + jsonPath: str + """ + jsonPath is a simple JSON path which is evaluated against each custom resource to produce a + field selector value. + Only JSON paths without the array notation are allowed. + Must point to a field of type string, boolean or integer. Types with enum values + and strings with formats are allowed. + If jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string. + Must not point to metdata fields. + Required. + """ + + +class Scale(BaseModel): + labelSelectorPath: Optional[str] = None + """ + labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. + Only JSON paths without the array notation are allowed. + Must be a JSON Path under `.status` or `.spec`. + Must be set to work with HorizontalPodAutoscaler. + The field pointed by this JSON path must be a string field (not a complex selector struct) + which contains a serialized label selector in string form. + More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource + If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` + subresource will default to the empty string. + """ + specReplicasPath: str + """ + specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. + Only JSON paths without the array notation are allowed. + Must be a JSON Path under `.spec`. + If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET. + """ + statusReplicasPath: str + """ + statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. + Only JSON paths without the array notation are allowed. + Must be a JSON Path under `.status`. + If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource + will default to 0. + """ + + +class Subresources(BaseModel): + scale: Optional[Scale] = None + """ + scale indicates the custom resource should serve a `/scale` subresource that returns an `autoscaling/v1` Scale object. + """ + status: Optional[Dict[str, Any]] = None + """ + status indicates the custom resource should serve a `/status` subresource. + When enabled: + 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. + 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object. + """ + + +class Version(BaseModel): + additionalPrinterColumns: Optional[List[AdditionalPrinterColumn]] = None + """ + AdditionalPrinterColumns specifies additional columns returned in Table output. + See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. + If no columns are specified, a single column displaying the age of the custom resource is used. + """ + deprecated: Optional[bool] = None + """ + Deprecated indicates this version of the custom resource API is deprecated. + When set to true, API requests to this version receive a warning header in the server response. + Defaults to false. + """ + deprecationWarning: Optional[str] = None + """ + DeprecationWarning overrides the default warning returned to API clients. + May only be set when `deprecated` is true. + The default warning indicates this version is deprecated and recommends use + of the newest served version of equal or greater stability, if one exists. + """ + name: str + """ + Name is the version name, e.g. “v1”, “v2beta1”, etc. + The custom resources are served under this version at `/apis///...` if `served` is true. + """ + schema_: Optional[Schema] = Field(None, alias='schema') + """ + Schema describes the schema used for validation, pruning, and defaulting of this version of the custom resource. + """ + selectableFields: Optional[List[SelectableField]] = None + """ + SelectableFields specifies paths to fields that may be used as field selectors. + A maximum of 8 selectable fields are allowed. + See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors + """ + served: bool + """ + Served is a flag enabling/disabling this version from being served via REST APIs + """ + storage: bool + """ + Storage indicates this version should be used when persisting custom resources to storage. + There must be exactly one version with storage=true. + """ + subresources: Optional[Subresources] = None + """ + Subresources specify what subresources this version of the defined custom resource have. + """ + + +class Spec(BaseModel): + connectionDetails: Optional[List[ConnectionDetail]] = None + """ + ConnectionDetails is an array of connection detail keys and descriptions. + """ + conversion: Optional[Conversion] = None + """ + Conversion defines conversion settings for the CRD. + """ + group: str + """ + Group is the API group of the defined custom resource. + The custom resources are served under `/apis//...`. + Must match the name of the CustomResourceDefinition (in the form `.`). + """ + names: Names + """ + Names specify the resource and kind names for the custom resource. + """ + preserveUnknownFields: Optional[bool] = None + """ + PreserveUnknownFields indicates that object fields which are not specified + in the OpenAPI schema should be preserved when persisting to storage. + apiVersion, kind, metadata and known fields inside metadata are always preserved. + This field is deprecated in favor of setting `x-preserve-unknown-fields` to true in `spec.versions[*].schema.openAPIV3Schema`. + See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning for details. + """ + scope: Literal['Namespaced', 'Cluster'] + """ + Scope indicates whether the defined custom resource is cluster- or namespace-scoped. + Allowed values are `Cluster` and `Namespaced`. + """ + state: Optional[Literal['Active', 'Inactive']] = 'Inactive' + """ + State toggles whether the underlying CRD is created or not. + """ + versions: List[Version] + """ + Versions is the list of all API versions of the defined custom resource. + Version names are used to compute the order in which served versions are listed in API discovery. + If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered + lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), + then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first + by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing + major version, then minor version. An example sorted list of versions: + v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class ManagedResourceDefinition(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1alpha1']] = ( + 'apiextensions.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ManagedResourceDefinition']] = 'ManagedResourceDefinition' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + ManagedResourceDefinitionSpec specifies the desired state of the resource definition. + """ + status: Optional[Status] = None + """ + ManagedResourceDefinitionStatus shows the observed state of the resource definition. + """ + + +class ManagedResourceDefinitionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ManagedResourceDefinition] + """ + List of managedresourcedefinitions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/usage/__init__.py b/schemas/python/models/io/crossplane/apiextensions/usage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/apiextensions/usage/v1alpha1.py b/schemas/python/models/io/crossplane/apiextensions/usage/v1alpha1.py new file mode 100644 index 000000000..a8e391d1f --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/usage/v1alpha1.py @@ -0,0 +1,174 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1alpha1_usage.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ResourceRef(BaseModel): + name: str + """ + Name of the referent. + """ + + +class ResourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + + +class By(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRef] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelector] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class Of(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRef] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelector] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class Spec(BaseModel): + by: Optional[By] = None + """ + By is the resource that is "using the other resource". + """ + of: Of + """ + Of is the resource that is "being used". + """ + reason: Optional[str] = None + """ + Reason is the reason for blocking deletion of the resource. + """ + replayDeletion: Optional[bool] = None + """ + ReplayDeletion will trigger a deletion on the used resource during the deletion of the usage itself, if it was attempted to be deleted at least once. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class Usage(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1alpha1']] = ( + 'apiextensions.crossplane.io/v1alpha1' + ) + """ + 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[Literal['Usage']] = 'Usage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + UsageSpec defines the desired state of Usage. + """ + status: Optional[Status] = None + """ + UsageStatus defines the observed state of Usage. + """ + + +class UsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Usage] + """ + List of usages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/apiextensions/usage/v1beta1.py b/schemas/python/models/io/crossplane/apiextensions/usage/v1beta1.py new file mode 100644 index 000000000..a79c96606 --- /dev/null +++ b/schemas/python/models/io/crossplane/apiextensions/usage/v1beta1.py @@ -0,0 +1,174 @@ +# generated by datamodel-codegen: +# filename: workdir/apiextensions_crossplane_io_v1beta1_usage.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ResourceRef(BaseModel): + name: str + """ + Name of the referent. + """ + + +class ResourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + + +class By(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRef] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelector] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class Of(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRef] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelector] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class Spec(BaseModel): + by: Optional[By] = None + """ + By is the resource that is "using the other resource". + """ + of: Of + """ + Of is the resource that is "being used". + """ + reason: Optional[str] = None + """ + Reason is the reason for blocking deletion of the resource. + """ + replayDeletion: Optional[bool] = None + """ + ReplayDeletion will trigger a deletion on the used resource during the deletion of the usage itself, if it was attempted to be deleted at least once. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class Usage(BaseModel): + apiVersion: Optional[Literal['apiextensions.crossplane.io/v1beta1']] = ( + 'apiextensions.crossplane.io/v1beta1' + ) + """ + 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[Literal['Usage']] = 'Usage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + UsageSpec defines the desired state of Usage. + """ + status: Optional[Status] = None + """ + UsageStatus defines the observed state of Usage. + """ + + +class UsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Usage] + """ + List of usages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/helm/__init__.py b/schemas/python/models/io/crossplane/helm/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/helm/providerconfig/__init__.py b/schemas/python/models/io/crossplane/helm/providerconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/helm/providerconfig/v1alpha1.py b/schemas/python/models/io/crossplane/helm/providerconfig/v1alpha1.py new file mode 100644 index 000000000..d1119e430 --- /dev/null +++ b/schemas/python/models/io/crossplane/helm/providerconfig/v1alpha1.py @@ -0,0 +1,189 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_crossplane_io_v1alpha1_providerconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Env(BaseModel): + name: str + """ + Name is the name of an environment variable. + """ + + +class Fs(BaseModel): + path: str + """ + Path is a filesystem path. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credentials(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + + +class Identity(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + type: Literal['GoogleApplicationCredentials'] = 'GoogleApplicationCredentials' + """ + Type of identity. + """ + + +class Spec(BaseModel): + credentials: Credentials + """ + Credentials used to connect to the Kubernetes API. Typically a + kubeconfig file. Use InjectedIdentity for in-cluster config. + """ + identity: Optional[Identity] = None + """ + Identity used to authenticate to the Kubernetes API. The identity + credentials can be used to supplement kubeconfig 'credentials', for + example by configuring a bearer token source such as OAuth. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + users: Optional[int] = None + """ + Users of this provider configuration. + """ + + +class ProviderConfig(BaseModel): + apiVersion: Optional[Literal['helm.crossplane.io/v1alpha1']] = ( + 'helm.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ProviderConfig']] = 'ProviderConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ProviderConfigSpec defines the desired state of a Provider. + """ + status: Optional[Status] = None + """ + A ProviderConfigStatus defines the status of a Provider. + """ + + +class ProviderConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfig] + """ + List of providerconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/helm/providerconfig/v1beta1.py b/schemas/python/models/io/crossplane/helm/providerconfig/v1beta1.py new file mode 100644 index 000000000..5a3545d04 --- /dev/null +++ b/schemas/python/models/io/crossplane/helm/providerconfig/v1beta1.py @@ -0,0 +1,195 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_crossplane_io_v1beta1_providerconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Env(BaseModel): + name: str + """ + Name is the name of an environment variable. + """ + + +class Fs(BaseModel): + path: str + """ + Path is a filesystem path. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credentials(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + + +class Identity(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + type: Literal[ + 'GoogleApplicationCredentials', + 'AzureServicePrincipalCredentials', + 'AzureWorkloadIdentityCredentials', + 'UpboundTokens', + 'AWSWebIdentityCredentials', + ] + """ + Type of identity. + """ + + +class Spec(BaseModel): + credentials: Credentials + """ + Credentials used to connect to the Kubernetes API. Typically a + kubeconfig file. Use InjectedIdentity for in-cluster config. + """ + identity: Optional[Identity] = None + """ + Identity used to authenticate to the Kubernetes API. The identity + credentials can be used to supplement kubeconfig 'credentials', for + example by configuring a bearer token source such as OAuth. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + users: Optional[int] = None + """ + Users of this provider configuration. + """ + + +class ProviderConfig(BaseModel): + apiVersion: Optional[Literal['helm.crossplane.io/v1beta1']] = ( + 'helm.crossplane.io/v1beta1' + ) + """ + 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[Literal['ProviderConfig']] = 'ProviderConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ProviderConfigSpec defines the desired state of a ProviderConfig. + """ + status: Optional[Status] = None + """ + A ProviderConfigStatus defines the status of a Provider. + """ + + +class ProviderConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfig] + """ + List of providerconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/helm/providerconfigusage/__init__.py b/schemas/python/models/io/crossplane/helm/providerconfigusage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/helm/providerconfigusage/v1alpha1.py b/schemas/python/models/io/crossplane/helm/providerconfigusage/v1alpha1.py new file mode 100644 index 000000000..584d55d99 --- /dev/null +++ b/schemas/python/models/io/crossplane/helm/providerconfigusage/v1alpha1.py @@ -0,0 +1,101 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_crossplane_io_v1alpha1_providerconfigusage.yaml + +from __future__ import annotations + +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ResourceRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class ProviderConfigUsage(BaseModel): + apiVersion: Optional[Literal['helm.crossplane.io/v1alpha1']] = ( + 'helm.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ProviderConfigUsage']] = 'ProviderConfigUsage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + providerConfigRef: ProviderConfigRef + """ + ProviderConfigReference to the provider config being used. + """ + resourceRef: ResourceRef + """ + ResourceReference to the managed resource using the provider config. + """ + + +class ProviderConfigUsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfigUsage] + """ + List of providerconfigusages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/helm/providerconfigusage/v1beta1.py b/schemas/python/models/io/crossplane/helm/providerconfigusage/v1beta1.py new file mode 100644 index 000000000..dce157ba7 --- /dev/null +++ b/schemas/python/models/io/crossplane/helm/providerconfigusage/v1beta1.py @@ -0,0 +1,101 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_crossplane_io_v1beta1_providerconfigusage.yaml + +from __future__ import annotations + +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ResourceRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class ProviderConfigUsage(BaseModel): + apiVersion: Optional[Literal['helm.crossplane.io/v1beta1']] = ( + 'helm.crossplane.io/v1beta1' + ) + """ + 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[Literal['ProviderConfigUsage']] = 'ProviderConfigUsage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + providerConfigRef: ProviderConfigRef + """ + ProviderConfigReference to the provider config being used. + """ + resourceRef: ResourceRef + """ + ResourceReference to the managed resource using the provider config. + """ + + +class ProviderConfigUsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfigUsage] + """ + List of providerconfigusages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/helm/release/__init__.py b/schemas/python/models/io/crossplane/helm/release/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/helm/release/v1alpha1.py b/schemas/python/models/io/crossplane/helm/release/v1alpha1.py new file mode 100644 index 000000000..a11f63348 --- /dev/null +++ b/schemas/python/models/io/crossplane/helm/release/v1alpha1.py @@ -0,0 +1,296 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_crossplane_io_v1alpha1_release.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PullSecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Chart(BaseModel): + name: str + pullSecretRef: Optional[PullSecretRef] = None + """ + A SecretReference is a reference to a secret in an arbitrary namespace. + """ + repository: str + version: str + + +class ConfigMapKeyRef(BaseModel): + key: Optional[str] = None + name: str + namespace: str + optional: Optional[bool] = None + + +class SecretKeyRef(BaseModel): + key: Optional[str] = None + name: str + namespace: str + optional: Optional[bool] = None + + +class PatchesFromItem(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class ValueFrom(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class SetItem(BaseModel): + name: str + value: Optional[str] = None + valueFrom: Optional[ValueFrom] = None + """ + ValueFromSource represents source of a value + """ + + +class ValuesFromItem(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class ForProvider(BaseModel): + chart: Chart + """ + A ChartSpec defines the chart spec for a Release + """ + namespace: str + patchesFrom: Optional[List[PatchesFromItem]] = None + set: Optional[List[SetItem]] = None + values: Optional[Dict[str, Any]] = None + valuesFrom: Optional[List[ValuesFromItem]] = None + wait: Optional[bool] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + """ + ReleaseParameters are the configurable fields of a Release. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + rollbackLimit: Optional[int] = None + """ + RollbackRetriesLimit is max number of attempts to retry Helm deployment by rolling back the release. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + releaseDescription: Optional[str] = None + revision: Optional[int] = None + state: Optional[str] = None + """ + Status is the status of a release + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + """ + ReleaseObservation are the observable fields of a Release. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + failed: Optional[int] = None + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + patchesSha: Optional[str] = None + synced: Optional[bool] = None + + +class Release(BaseModel): + apiVersion: Optional[Literal['helm.crossplane.io/v1alpha1']] = ( + 'helm.crossplane.io/v1alpha1' + ) + """ + 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[Literal['Release']] = 'Release' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ReleaseSpec defines the desired state of a Release. + """ + status: Optional[Status] = None + """ + A ReleaseStatus represents the observed state of a Release. + """ + + +class ReleaseList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Release] + """ + List of releases. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/helm/release/v1beta1.py b/schemas/python/models/io/crossplane/helm/release/v1beta1.py new file mode 100644 index 000000000..eccf48521 --- /dev/null +++ b/schemas/python/models/io/crossplane/helm/release/v1beta1.py @@ -0,0 +1,389 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_crossplane_io_v1beta1_release.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConnectionDetail(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + fieldPath: Optional[str] = None + """ + 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] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + name: Optional[str] = None + """ + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + namespace: Optional[str] = None + """ + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + """ + resourceVersion: Optional[str] = None + """ + 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 + """ + skipPartOfReleaseCheck: Optional[bool] = None + """ + SkipPartOfReleaseCheck skips check for meta.helm.sh/release-name annotation. + """ + toConnectionSecretKey: Optional[str] = None + uid: Optional[str] = None + """ + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + """ + + +class PullSecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Chart(BaseModel): + name: Optional[str] = None + """ + Name of Helm chart, required if ChartSpec.URL not set + """ + pullSecretRef: Optional[PullSecretRef] = None + """ + PullSecretRef is reference to the secret containing credentials to helm repository. + The secret must contain 'username' and 'password' keys. Optional - if not provided, + the default credential chain is used (AWS IRSA, Azure/GCP Workload Identity, etc.). + """ + repository: Optional[str] = None + """ + Repository: Helm repository URL, required if ChartSpec.URL not set + """ + url: Optional[str] = None + """ + URL to chart package (typically .tgz), optional and overrides others fields in the spec + """ + version: Optional[str] = None + """ + Version of Helm chart, late initialized with latest version if not set + """ + + +class ConfigMapKeyRef(BaseModel): + key: Optional[str] = None + name: str + namespace: str + optional: Optional[bool] = None + + +class SecretKeyRef(BaseModel): + key: Optional[str] = None + name: str + namespace: str + optional: Optional[bool] = None + + +class PatchesFromItem(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class ValueFrom(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class SetItem(BaseModel): + name: str + value: Optional[str] = None + valueFrom: Optional[ValueFrom] = None + """ + ValueFromSource represents source of a value + """ + + +class ValuesFromItem(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class ForProvider(BaseModel): + chart: Chart + """ + A ChartSpec defines the chart spec for a Release + """ + insecureSkipTLSVerify: Optional[bool] = None + """ + InsecureSkipTLSVerify skips tls certificate checks for the chart download + """ + namespace: str + """ + Namespace to install the release into. + """ + patchesFrom: Optional[List[PatchesFromItem]] = None + """ + PatchesFrom describe patches to be applied to the rendered manifests. + """ + plainHTTP: Optional[bool] = None + """ + PlainHTTP uses insecure HTTP connections for the chart download + """ + set: Optional[List[SetItem]] = None + skipCRDs: Optional[bool] = None + """ + SkipCRDs skips installation of CRDs for the release. + """ + skipCreateNamespace: Optional[bool] = None + """ + SkipCreateNamespace won't create the namespace for the release. This requires the namespace to already exist. + """ + values: Optional[Dict[str, Any]] = None + valuesFrom: Optional[List[ValuesFromItem]] = None + wait: Optional[bool] = None + """ + Wait for the release to become ready. + """ + waitTimeout: Optional[str] = None + """ + WaitTimeout is the duration Helm will wait for the release to become + ready. Only applies if wait is also set. Defaults to 5m. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + connectionDetails: Optional[List[ConnectionDetail]] = None + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + """ + ReleaseParameters are the configurable fields of a Release. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + rollbackLimit: Optional[int] = None + """ + RollbackRetriesLimit is max number of attempts to retry Helm deployment by rolling back the release. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + releaseDescription: Optional[str] = None + revision: Optional[int] = None + state: Optional[str] = None + """ + Status is the status of a release + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + """ + ReleaseObservation are the observable fields of a Release. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + failed: Optional[int] = None + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + patchesSha: Optional[str] = None + synced: Optional[bool] = None + + +class Release(BaseModel): + apiVersion: Optional[Literal['helm.crossplane.io/v1beta1']] = ( + 'helm.crossplane.io/v1beta1' + ) + """ + 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[Literal['Release']] = 'Release' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ReleaseSpec defines the desired state of a Release. + """ + status: Optional[Status] = None + """ + A ReleaseStatus represents the observed state of a Release. + """ + + +class ReleaseList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Release] + """ + List of releases. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/kubernetes/__init__.py b/schemas/python/models/io/crossplane/kubernetes/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/kubernetes/object/__init__.py b/schemas/python/models/io/crossplane/kubernetes/object/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/kubernetes/object/v1alpha1.py b/schemas/python/models/io/crossplane/kubernetes/object/v1alpha1.py new file mode 100644 index 000000000..26b37501c --- /dev/null +++ b/schemas/python/models/io/crossplane/kubernetes/object/v1alpha1.py @@ -0,0 +1,348 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_crossplane_io_v1alpha1_object.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConnectionDetail(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + fieldPath: Optional[str] = None + """ + 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] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + name: Optional[str] = None + """ + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + namespace: Optional[str] = None + """ + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + """ + resourceVersion: Optional[str] = None + """ + 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 + """ + toConnectionSecretKey: Optional[str] = None + uid: Optional[str] = None + """ + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + """ + + +class ForProvider(BaseModel): + manifest: Dict[str, Any] + """ + Raw JSON representation of the kubernetes object to be created. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProviderRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class Readiness(BaseModel): + policy: Optional[Literal['SuccessfulCreate', 'DeriveFromObject', 'AllTrue']] = ( + 'SuccessfulCreate' + ) + """ + Policy defines how the Object's readiness condition should be computed. + """ + + +class DependsOn(BaseModel): + apiVersion: Optional[str] = 'kubernetes.crossplane.io/v1alpha1' + """ + APIVersion of the referenced object. + """ + kind: Optional[str] = 'Object' + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object. + """ + + +class PatchesFrom(BaseModel): + apiVersion: Optional[str] = 'kubernetes.crossplane.io/v1alpha1' + """ + APIVersion of the referenced object. + """ + fieldPath: str + """ + FieldPath is the path of the field on the resource whose value is to be + used as input. + """ + kind: Optional[str] = 'Object' + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object. + """ + + +class Reference(BaseModel): + dependsOn: Optional[DependsOn] = None + """ + DependsOn is used to declare dependency on other Object or arbitrary + Kubernetes resource. + """ + patchesFrom: Optional[PatchesFrom] = None + """ + PatchesFrom is used to declare dependency on other Object or arbitrary + Kubernetes resource, and also patch fields from this object. + """ + toFieldPath: Optional[str] = None + """ + ToFieldPath is the path of the field on the resource whose value will + be changed with the result of transforms. Leave empty if you'd like to + propagate to the same path as patchesFrom.fieldPath. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + connectionDetails: Optional[List[ConnectionDetail]] = None + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicy + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + """ + ObjectParameters are the configurable fields of a Object. + """ + managementPolicy: Optional[ + Literal['Default', 'ObserveCreateUpdate', 'ObserveDelete', 'Observe'] + ] = 'Default' + """ + A ManagementPolicy determines what should happen to the underlying external + resource when a managed resource is created, updated, deleted, or observed. + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + providerRef: Optional[ProviderRef] = None + """ + ProviderReference specifies the provider that will be used to create, + observe, update, and delete this managed resource. + + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef` + """ + readiness: Optional[Readiness] = None + """ + Readiness defines how the object's readiness condition should be computed, + if not specified it will be considered ready as soon as the underlying external + resource is considered up-to-date. + """ + references: Optional[List[Reference]] = None + watch: Optional[bool] = False + """ + Watch enables watching the referenced or managed kubernetes resources. + + THIS IS AN ALPHA FIELD. Do not use it in production. It is not honored + unless "watches" feature gate is enabled, and may be changed or removed + without notice. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + """ + + +class AtProvider(BaseModel): + manifest: Optional[Dict[str, Any]] = None + """ + Raw JSON representation of the remote object. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + """ + ObjectObservation are the observable fields of a Object. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Object(BaseModel): + apiVersion: Optional[Literal['kubernetes.crossplane.io/v1alpha1']] = ( + 'kubernetes.crossplane.io/v1alpha1' + ) + """ + 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[Literal['Object']] = 'Object' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ObjectSpec defines the desired state of a Object. + """ + status: Optional[Status] = None + """ + A ObjectStatus represents the observed state of a Object. + """ + + +class ObjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Object] + """ + List of objects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/kubernetes/object/v1alpha2.py b/schemas/python/models/io/crossplane/kubernetes/object/v1alpha2.py new file mode 100644 index 000000000..f14c72dbc --- /dev/null +++ b/schemas/python/models/io/crossplane/kubernetes/object/v1alpha2.py @@ -0,0 +1,345 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_crossplane_io_v1alpha2_object.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConnectionDetail(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + fieldPath: Optional[str] = None + """ + 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] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + name: Optional[str] = None + """ + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + namespace: Optional[str] = None + """ + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + """ + resourceVersion: Optional[str] = None + """ + 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 + """ + toConnectionSecretKey: Optional[str] = None + uid: Optional[str] = None + """ + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + """ + + +class ForProvider(BaseModel): + manifest: Dict[str, Any] + """ + Raw JSON representation of the kubernetes object to be created. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class Readiness(BaseModel): + celQuery: Optional[str] = None + """ + CelQuery defines a cel query to evaluate the readiness. The + observed object is passed to the cel query with the word `object`. + Cel macros are available to be used, see https://github.com/google/cel-spec/blob/master/doc/langdef.md#macros + for more information. + Examples: + `object.status.isReady == true`: checks for a boolean field called isReady on status. + `object.status.conditions.all(x, x.status == "True")` mimics the behavior of the AllTrue readiness policy + `object.status.conditions.exists(c, c.type == "condition1" && c.status == "True" )` checks just one condition + """ + policy: Optional[ + Literal['SuccessfulCreate', 'DeriveFromObject', 'AllTrue', 'DeriveFromCelQuery'] + ] = 'SuccessfulCreate' + """ + Policy defines how the Object's readiness condition should be computed. + """ + + +class DependsOn(BaseModel): + apiVersion: Optional[str] = 'kubernetes.crossplane.io/v1alpha1' + """ + APIVersion of the referenced object. + """ + kind: Optional[str] = 'Object' + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object. + """ + + +class PatchesFrom(BaseModel): + apiVersion: Optional[str] = 'kubernetes.crossplane.io/v1alpha1' + """ + APIVersion of the referenced object. + """ + fieldPath: str + """ + FieldPath is the path of the field on the resource whose value is to be + used as input. + """ + kind: Optional[str] = 'Object' + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object. + """ + + +class Reference(BaseModel): + dependsOn: Optional[DependsOn] = None + """ + DependsOn is used to declare dependency on other Object or arbitrary + Kubernetes resource. + """ + patchesFrom: Optional[PatchesFrom] = None + """ + PatchesFrom is used to declare dependency on other Object or arbitrary + Kubernetes resource, and also patch fields from this object. + """ + toFieldPath: Optional[str] = None + """ + ToFieldPath is the path of the field on the resource whose value will + be changed with the result of transforms. Leave empty if you'd like to + propagate to the same path as patchesFrom.fieldPath. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + connectionDetails: Optional[List[ConnectionDetail]] = None + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + """ + ObjectParameters are the configurable fields of a Object. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + readiness: Optional[Readiness] = None + """ + Readiness defines how the object's readiness condition should be computed, + if not specified it will be considered ready as soon as the underlying external + resource is considered up-to-date. + """ + references: Optional[List[Reference]] = None + watch: Optional[bool] = False + """ + Watch enables watching the referenced or managed kubernetes resources. + + THIS IS AN ALPHA FIELD. Do not use it in production. It is not honored + unless "watches" feature gate is enabled, and may be changed or removed + without notice. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + manifest: Optional[Dict[str, Any]] = None + """ + Raw JSON representation of the remote object. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + """ + ObjectObservation are the observable fields of a Object. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Object(BaseModel): + apiVersion: Optional[Literal['kubernetes.crossplane.io/v1alpha2']] = ( + 'kubernetes.crossplane.io/v1alpha2' + ) + """ + 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[Literal['Object']] = 'Object' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ObjectSpec defines the desired state of a Object. + """ + status: Optional[Status] = None + """ + A ObjectStatus represents the observed state of a Object. + """ + + +class ObjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Object] + """ + List of objects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/kubernetes/observedobjectcollection/__init__.py b/schemas/python/models/io/crossplane/kubernetes/observedobjectcollection/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/kubernetes/observedobjectcollection/v1alpha1.py b/schemas/python/models/io/crossplane/kubernetes/observedobjectcollection/v1alpha1.py new file mode 100644 index 000000000..aeb5bdc88 --- /dev/null +++ b/schemas/python/models/io/crossplane/kubernetes/observedobjectcollection/v1alpha1.py @@ -0,0 +1,224 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_crossplane_io_v1alpha1_observedobjectcollection.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, constr + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + Annotations of an object + """ + labels: Optional[Dict[str, str]] = None + """ + Labels of an object + """ + + +class ObjectTemplate(BaseModel): + metadata: Optional[Metadata] = None + """ + Objects metadata + """ + + +class MatchExpression(BaseModel): + key: str + """ + key is the label key that the selector applies to. + """ + operator: str + """ + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + """ + values: Optional[List[str]] = None + """ + 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 Selector(BaseModel): + matchExpressions: Optional[List[MatchExpression]] = None + """ + matchExpressions is a list of label selector requirements. The requirements are ANDed. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + 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 ObserveObjects(BaseModel): + apiVersion: constr(min_length=1) + """ + APIVersion of objects that should be matched by the selector + """ + kind: constr(min_length=1) + """ + Kind of objects that should be matched by the selector + """ + namespace: Optional[str] = None + """ + Namespace where to look for objects. + If omitted, search is performed across all namespaces. + For cluster-scoped objects, omit it. + """ + selector: Selector + """ + Selector defines the criteria for including objects into the collection + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class Spec(BaseModel): + objectTemplate: Optional[ObjectTemplate] = None + """ + Template when defined is used for creating Object instances + """ + observeObjects: ObserveObjects + """ + ObserveObjects declares what criteria object need to fulfil + to become a member of this collection + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + membershipLabel: Optional[Dict[str, str]] = None + """ + MembershipLabel is the label set on each member of this collection + and can be used for fetching them. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ObservedObjectCollection(BaseModel): + apiVersion: Optional[Literal['kubernetes.crossplane.io/v1alpha1']] = ( + 'kubernetes.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ObservedObjectCollection']] = 'ObservedObjectCollection' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ObservedObjectCollectionSpec defines the desired state of ObservedObjectCollection + """ + status: Optional[Status] = None + """ + ObservedObjectCollectionStatus represents the observed state of a ObservedObjectCollection + """ + + +class ObservedObjectCollectionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ObservedObjectCollection] + """ + List of observedobjectcollections. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/kubernetes/providerconfig/__init__.py b/schemas/python/models/io/crossplane/kubernetes/providerconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/kubernetes/providerconfig/v1alpha1.py b/schemas/python/models/io/crossplane/kubernetes/providerconfig/v1alpha1.py new file mode 100644 index 000000000..f25cf82be --- /dev/null +++ b/schemas/python/models/io/crossplane/kubernetes/providerconfig/v1alpha1.py @@ -0,0 +1,195 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_crossplane_io_v1alpha1_providerconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Env(BaseModel): + name: str + """ + Name is the name of an environment variable. + """ + + +class Fs(BaseModel): + path: str + """ + Path is a filesystem path. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credentials(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + + +class Identity(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + type: Literal[ + 'GoogleApplicationCredentials', + 'AzureServicePrincipalCredentials', + 'AzureWorkloadIdentityCredentials', + 'UpboundTokens', + 'AWSWebIdentityCredentials', + ] + """ + Type of identity. + """ + + +class Spec(BaseModel): + credentials: Credentials + """ + Credentials used to connect to the Kubernetes API. Typically a + kubeconfig file. Use InjectedIdentity for in-cluster config. + """ + identity: Optional[Identity] = None + """ + Identity used to authenticate to the Kubernetes API. The identity + credentials can be used to supplement kubeconfig 'credentials', for + example by configuring a bearer token source such as OAuth. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + users: Optional[int] = None + """ + Users of this provider configuration. + """ + + +class ProviderConfig(BaseModel): + apiVersion: Optional[Literal['kubernetes.crossplane.io/v1alpha1']] = ( + 'kubernetes.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ProviderConfig']] = 'ProviderConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ProviderConfigSpec defines the desired state of a ProviderConfig. + """ + status: Optional[Status] = None + """ + A ProviderConfigStatus reflects the observed state of a ProviderConfig. + """ + + +class ProviderConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfig] + """ + List of providerconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/kubernetes/providerconfigusage/__init__.py b/schemas/python/models/io/crossplane/kubernetes/providerconfigusage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/kubernetes/providerconfigusage/v1alpha1.py b/schemas/python/models/io/crossplane/kubernetes/providerconfigusage/v1alpha1.py new file mode 100644 index 000000000..6bd934fe1 --- /dev/null +++ b/schemas/python/models/io/crossplane/kubernetes/providerconfigusage/v1alpha1.py @@ -0,0 +1,101 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_crossplane_io_v1alpha1_providerconfigusage.yaml + +from __future__ import annotations + +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ResourceRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class ProviderConfigUsage(BaseModel): + apiVersion: Optional[Literal['kubernetes.crossplane.io/v1alpha1']] = ( + 'kubernetes.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ProviderConfigUsage']] = 'ProviderConfigUsage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + providerConfigRef: ProviderConfigRef + """ + ProviderConfigReference to the provider config being used. + """ + resourceRef: ResourceRef + """ + ResourceReference to the managed resource using the provider config. + """ + + +class ProviderConfigUsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfigUsage] + """ + List of providerconfigusages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/__init__.py b/schemas/python/models/io/crossplane/m/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/helm/__init__.py b/schemas/python/models/io/crossplane/m/helm/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/helm/clusterproviderconfig/__init__.py b/schemas/python/models/io/crossplane/m/helm/clusterproviderconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/helm/clusterproviderconfig/v1beta1.py b/schemas/python/models/io/crossplane/m/helm/clusterproviderconfig/v1beta1.py new file mode 100644 index 000000000..632e965ec --- /dev/null +++ b/schemas/python/models/io/crossplane/m/helm/clusterproviderconfig/v1beta1.py @@ -0,0 +1,195 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_m_crossplane_io_v1beta1_clusterproviderconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Env(BaseModel): + name: str + """ + Name is the name of an environment variable. + """ + + +class Fs(BaseModel): + path: str + """ + Path is a filesystem path. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credentials(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + + +class Identity(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + type: Literal[ + 'GoogleApplicationCredentials', + 'AzureServicePrincipalCredentials', + 'AzureWorkloadIdentityCredentials', + 'UpboundTokens', + 'AWSWebIdentityCredentials', + ] + """ + Type of identity. + """ + + +class Spec(BaseModel): + credentials: Credentials + """ + Credentials used to connect to the Kubernetes API. Typically a + kubeconfig file. Use InjectedIdentity for in-cluster config. + """ + identity: Optional[Identity] = None + """ + Identity used to authenticate to the Kubernetes API. The identity + credentials can be used to supplement kubeconfig 'credentials', for + example by configuring a bearer token source such as OAuth. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + users: Optional[int] = None + """ + Users of this provider configuration. + """ + + +class ClusterProviderConfig(BaseModel): + apiVersion: Optional[Literal['helm.m.crossplane.io/v1beta1']] = ( + 'helm.m.crossplane.io/v1beta1' + ) + """ + 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[Literal['ClusterProviderConfig']] = 'ClusterProviderConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ProviderConfigSpec defines the desired state of a ProviderConfig. + """ + status: Optional[Status] = None + """ + A ProviderConfigStatus defines the status of a Provider. + """ + + +class ClusterProviderConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ClusterProviderConfig] + """ + List of clusterproviderconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/helm/providerconfig/__init__.py b/schemas/python/models/io/crossplane/m/helm/providerconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/helm/providerconfig/v1beta1.py b/schemas/python/models/io/crossplane/m/helm/providerconfig/v1beta1.py new file mode 100644 index 000000000..dfae1be44 --- /dev/null +++ b/schemas/python/models/io/crossplane/m/helm/providerconfig/v1beta1.py @@ -0,0 +1,195 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_m_crossplane_io_v1beta1_providerconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Env(BaseModel): + name: str + """ + Name is the name of an environment variable. + """ + + +class Fs(BaseModel): + path: str + """ + Path is a filesystem path. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credentials(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + + +class Identity(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + type: Literal[ + 'GoogleApplicationCredentials', + 'AzureServicePrincipalCredentials', + 'AzureWorkloadIdentityCredentials', + 'UpboundTokens', + 'AWSWebIdentityCredentials', + ] + """ + Type of identity. + """ + + +class Spec(BaseModel): + credentials: Credentials + """ + Credentials used to connect to the Kubernetes API. Typically a + kubeconfig file. Use InjectedIdentity for in-cluster config. + """ + identity: Optional[Identity] = None + """ + Identity used to authenticate to the Kubernetes API. The identity + credentials can be used to supplement kubeconfig 'credentials', for + example by configuring a bearer token source such as OAuth. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + users: Optional[int] = None + """ + Users of this provider configuration. + """ + + +class ProviderConfig(BaseModel): + apiVersion: Optional[Literal['helm.m.crossplane.io/v1beta1']] = ( + 'helm.m.crossplane.io/v1beta1' + ) + """ + 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[Literal['ProviderConfig']] = 'ProviderConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ProviderConfigSpec defines the desired state of a ProviderConfig. + """ + status: Optional[Status] = None + """ + A ProviderConfigStatus defines the status of a Provider. + """ + + +class ProviderConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfig] + """ + List of providerconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/helm/providerconfigusage/__init__.py b/schemas/python/models/io/crossplane/m/helm/providerconfigusage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/helm/providerconfigusage/v1beta1.py b/schemas/python/models/io/crossplane/m/helm/providerconfigusage/v1beta1.py new file mode 100644 index 000000000..900488da8 --- /dev/null +++ b/schemas/python/models/io/crossplane/m/helm/providerconfigusage/v1beta1.py @@ -0,0 +1,84 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_m_crossplane_io_v1beta1_providerconfigusage.yaml + +from __future__ import annotations + +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class ResourceRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class ProviderConfigUsage(BaseModel): + apiVersion: Optional[Literal['helm.m.crossplane.io/v1beta1']] = ( + 'helm.m.crossplane.io/v1beta1' + ) + """ + 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[Literal['ProviderConfigUsage']] = 'ProviderConfigUsage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + providerConfigRef: ProviderConfigRef + """ + ProviderConfigReference to the provider config being used. + """ + resourceRef: ResourceRef + """ + ResourceReference to the managed resource using the provider config. + """ + + +class ProviderConfigUsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfigUsage] + """ + List of providerconfigusages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/helm/release/__init__.py b/schemas/python/models/io/crossplane/m/helm/release/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/helm/release/v1beta1.py b/schemas/python/models/io/crossplane/m/helm/release/v1beta1.py new file mode 100644 index 000000000..d741ce59f --- /dev/null +++ b/schemas/python/models/io/crossplane/m/helm/release/v1beta1.py @@ -0,0 +1,351 @@ +# generated by datamodel-codegen: +# filename: workdir/helm_m_crossplane_io_v1beta1_release.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConnectionDetail(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + fieldPath: Optional[str] = None + """ + 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] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + name: Optional[str] = None + """ + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + namespace: Optional[str] = None + """ + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + """ + resourceVersion: Optional[str] = None + """ + 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 + """ + skipPartOfReleaseCheck: Optional[bool] = None + """ + SkipPartOfReleaseCheck skips check for meta.helm.sh/release-name annotation. + """ + toConnectionSecretKey: Optional[str] = None + uid: Optional[str] = None + """ + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + """ + + +class PullSecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Chart(BaseModel): + name: Optional[str] = None + """ + Name of Helm chart, required if ChartSpec.URL not set + """ + pullSecretRef: Optional[PullSecretRef] = None + """ + PullSecretRef is reference to the secret containing credentials to helm repository. + The secret must contain 'username' and 'password' keys. Optional - if not provided, + the default credential chain is used (AWS IRSA, Azure/GCP Workload Identity, etc.). + """ + repository: Optional[str] = None + """ + Repository: Helm repository URL, required if ChartSpec.URL not set + """ + url: Optional[str] = None + """ + URL to chart package (typically .tgz), optional and overrides others fields in the spec + """ + version: Optional[str] = None + """ + Version of Helm chart, late initialized with latest version if not set + """ + + +class ConfigMapKeyRef(BaseModel): + key: Optional[str] = None + name: str + optional: Optional[bool] = None + + +class SecretKeyRef(BaseModel): + key: Optional[str] = None + name: str + optional: Optional[bool] = None + + +class PatchesFromItem(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class ValueFrom(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class SetItem(BaseModel): + name: str + value: Optional[str] = None + valueFrom: Optional[ValueFrom] = None + """ + ValueFromSource represents source of a value + """ + + +class ValuesFromItem(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + DataKeySelector defines required spec to access a key of a configmap or secret + """ + + +class ForProvider(BaseModel): + chart: Chart + """ + A ChartSpec defines the chart spec for a Release + """ + insecureSkipTLSVerify: Optional[bool] = None + """ + InsecureSkipTLSVerify skips tls certificate checks for the chart download + """ + namespace: Optional[str] = None + """ + Namespace to install the release into. + The Release Managed Resource's namespace will be used if nothing is set. + """ + patchesFrom: Optional[List[PatchesFromItem]] = None + """ + PatchesFrom describe patches to be applied to the rendered manifests. + """ + plainHTTP: Optional[bool] = None + """ + PlainHTTP uses insecure HTTP connections for the chart download + """ + set: Optional[List[SetItem]] = None + skipCRDs: Optional[bool] = None + """ + SkipCRDs skips installation of CRDs for the release. + """ + skipCreateNamespace: Optional[bool] = None + """ + SkipCreateNamespace won't create the namespace for the release. This requires the namespace to already exist. + """ + values: Optional[Dict[str, Any]] = None + valuesFrom: Optional[List[ValuesFromItem]] = None + wait: Optional[bool] = None + """ + Wait for the release to become ready. + """ + waitTimeout: Optional[str] = None + """ + WaitTimeout is the duration Helm will wait for the release to become + ready. Only applies if wait is also set. Defaults to 5m. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + connectionDetails: Optional[List[ConnectionDetail]] = None + forProvider: ForProvider + """ + ReleaseParameters are the configurable fields of a Release. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + rollbackLimit: Optional[int] = None + """ + RollbackRetriesLimit is max number of attempts to retry Helm deployment by rolling back the release. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + releaseDescription: Optional[str] = None + revision: Optional[int] = None + state: Optional[str] = None + """ + Status is the status of a release + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + """ + ReleaseObservation are the observable fields of a Release. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + failed: Optional[int] = None + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + patchesSha: Optional[str] = None + synced: Optional[bool] = None + + +class Release(BaseModel): + apiVersion: Optional[Literal['helm.m.crossplane.io/v1beta1']] = ( + 'helm.m.crossplane.io/v1beta1' + ) + """ + 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[Literal['Release']] = 'Release' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ReleaseSpec defines the desired state of a Release. + """ + status: Optional[Status] = None + """ + A ReleaseStatus represents the observed state of a Release. + """ + + +class ReleaseList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Release] + """ + List of releases. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/kubernetes/__init__.py b/schemas/python/models/io/crossplane/m/kubernetes/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/kubernetes/clusterproviderconfig/__init__.py b/schemas/python/models/io/crossplane/m/kubernetes/clusterproviderconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/kubernetes/clusterproviderconfig/v1alpha1.py b/schemas/python/models/io/crossplane/m/kubernetes/clusterproviderconfig/v1alpha1.py new file mode 100644 index 000000000..27162f0d9 --- /dev/null +++ b/schemas/python/models/io/crossplane/m/kubernetes/clusterproviderconfig/v1alpha1.py @@ -0,0 +1,195 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_m_crossplane_io_v1alpha1_clusterproviderconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Env(BaseModel): + name: str + """ + Name is the name of an environment variable. + """ + + +class Fs(BaseModel): + path: str + """ + Path is a filesystem path. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credentials(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + + +class Identity(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + type: Literal[ + 'GoogleApplicationCredentials', + 'AzureServicePrincipalCredentials', + 'AzureWorkloadIdentityCredentials', + 'UpboundTokens', + 'AWSWebIdentityCredentials', + ] + """ + Type of identity. + """ + + +class Spec(BaseModel): + credentials: Credentials + """ + Credentials used to connect to the Kubernetes API. Typically a + kubeconfig file. Use InjectedIdentity for in-cluster config. + """ + identity: Optional[Identity] = None + """ + Identity used to authenticate to the Kubernetes API. The identity + credentials can be used to supplement kubeconfig 'credentials', for + example by configuring a bearer token source such as OAuth. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + users: Optional[int] = None + """ + Users of this provider configuration. + """ + + +class ClusterProviderConfig(BaseModel): + apiVersion: Optional[Literal['kubernetes.m.crossplane.io/v1alpha1']] = ( + 'kubernetes.m.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ClusterProviderConfig']] = 'ClusterProviderConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ProviderConfigSpec defines the desired state of a ProviderConfig. + """ + status: Optional[Status] = None + """ + A ProviderConfigStatus reflects the observed state of a ProviderConfig. + """ + + +class ClusterProviderConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ClusterProviderConfig] + """ + List of clusterproviderconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/kubernetes/object/__init__.py b/schemas/python/models/io/crossplane/m/kubernetes/object/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/kubernetes/object/v1alpha1.py b/schemas/python/models/io/crossplane/m/kubernetes/object/v1alpha1.py new file mode 100644 index 000000000..65f380904 --- /dev/null +++ b/schemas/python/models/io/crossplane/m/kubernetes/object/v1alpha1.py @@ -0,0 +1,312 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_m_crossplane_io_v1alpha1_object.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConnectionDetail(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + fieldPath: Optional[str] = None + """ + 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] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + name: Optional[str] = None + """ + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + namespace: Optional[str] = None + """ + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + """ + resourceVersion: Optional[str] = None + """ + 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 + """ + toConnectionSecretKey: Optional[str] = None + uid: Optional[str] = None + """ + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + """ + + +class ForProvider(BaseModel): + manifest: Dict[str, Any] + """ + Raw JSON representation of the kubernetes object to be created. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class Readiness(BaseModel): + celQuery: Optional[str] = None + """ + CelQuery defines a cel query to evaluate the readiness. The + observed object is passed to the cel query with the word `object`. + Cel macros are available to be used, see https://github.com/google/cel-spec/blob/master/doc/langdef.md#macros + for more information. + Examples: + `object.status.isReady == true`: checks for a boolean field called isReady on status. + `object.status.conditions.all(x, x.status == "True")` mimics the behavior of the AllTrue readiness policy + `object.status.conditions.exists(c, c.type == "condition1" && c.status == "True" )` checks just one condition + """ + policy: Optional[ + Literal['SuccessfulCreate', 'DeriveFromObject', 'AllTrue', 'DeriveFromCelQuery'] + ] = 'SuccessfulCreate' + """ + Policy defines how the Object's readiness condition should be computed. + """ + + +class DependsOn(BaseModel): + apiVersion: Optional[str] = 'kubernetes.m.crossplane.io/v1alpha1' + """ + APIVersion of the referenced object. + """ + kind: Optional[str] = 'Object' + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object. + """ + + +class PatchesFrom(BaseModel): + apiVersion: Optional[str] = 'kubernetes.m.crossplane.io/v1alpha1' + """ + APIVersion of the referenced object. + """ + fieldPath: str + """ + FieldPath is the path of the field on the resource whose value is to be + used as input. + """ + kind: Optional[str] = 'Object' + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object. + """ + + +class Reference(BaseModel): + dependsOn: Optional[DependsOn] = None + """ + DependsOn is used to declare dependency on other Object or arbitrary + Kubernetes resource. + """ + patchesFrom: Optional[PatchesFrom] = None + """ + PatchesFrom is used to declare dependency on other Object or arbitrary + Kubernetes resource, and also patch fields from this object. + """ + toFieldPath: Optional[str] = None + """ + ToFieldPath is the path of the field on the resource whose value will + be changed with the result of transforms. Leave empty if you'd like to + propagate to the same path as patchesFrom.fieldPath. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + connectionDetails: Optional[List[ConnectionDetail]] = None + forProvider: ForProvider + """ + ObjectParameters are the configurable fields of a Object. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + readiness: Optional[Readiness] = None + """ + Readiness defines how the object's readiness condition should be computed, + if not specified it will be considered ready as soon as the underlying external + resource is considered up-to-date. + """ + references: Optional[List[Reference]] = None + watch: Optional[bool] = False + """ + Watch enables watching the referenced or managed kubernetes resources. + + THIS IS AN ALPHA FIELD. Do not use it in production. It is not honored + unless "watches" feature gate is enabled, and may be changed or removed + without notice. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + manifest: Optional[Dict[str, Any]] = None + """ + Raw JSON representation of the remote object. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + """ + ObjectObservation are the observable fields of a Object. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Object(BaseModel): + apiVersion: Optional[Literal['kubernetes.m.crossplane.io/v1alpha1']] = ( + 'kubernetes.m.crossplane.io/v1alpha1' + ) + """ + 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[Literal['Object']] = 'Object' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ObjectSpec defines the desired state of a Object. + """ + status: Optional[Status] = None + """ + A ObjectStatus represents the observed state of a Object. + """ + + +class ObjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Object] + """ + List of objects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/kubernetes/observedobjectcollection/__init__.py b/schemas/python/models/io/crossplane/m/kubernetes/observedobjectcollection/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/kubernetes/observedobjectcollection/v1alpha1.py b/schemas/python/models/io/crossplane/m/kubernetes/observedobjectcollection/v1alpha1.py new file mode 100644 index 000000000..42aaa52f3 --- /dev/null +++ b/schemas/python/models/io/crossplane/m/kubernetes/observedobjectcollection/v1alpha1.py @@ -0,0 +1,209 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_m_crossplane_io_v1alpha1_observedobjectcollection.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field, constr + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + Annotations of an object + """ + labels: Optional[Dict[str, str]] = None + """ + Labels of an object + """ + + +class ObjectTemplate(BaseModel): + metadata: Optional[Metadata] = None + """ + Objects metadata + """ + + +class MatchExpression(BaseModel): + key: str + """ + key is the label key that the selector applies to. + """ + operator: str + """ + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + """ + values: Optional[List[str]] = None + """ + 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 Selector(BaseModel): + matchExpressions: Optional[List[MatchExpression]] = None + """ + matchExpressions is a list of label selector requirements. The requirements are ANDed. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + 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 ObserveObjects(BaseModel): + apiVersion: constr(min_length=1) + """ + APIVersion of objects that should be matched by the selector + """ + kind: constr(min_length=1) + """ + Kind of objects that should be matched by the selector + """ + namespace: Optional[str] = None + """ + Namespace where to look for objects. + If omitted, search is performed across all namespaces. + For cluster-scoped objects, omit it. + """ + selector: Selector + """ + Selector defines the criteria for including objects into the collection + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class Spec(BaseModel): + objectTemplate: Optional[ObjectTemplate] = None + """ + Template when defined is used for creating Object instances + """ + observeObjects: ObserveObjects + """ + ObserveObjects declares what criteria object need to fulfil + to become a member of this collection + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + membershipLabel: Optional[Dict[str, str]] = None + """ + MembershipLabel is the label set on each member of this collection + and can be used for fetching them. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ObservedObjectCollection(BaseModel): + apiVersion: Optional[Literal['kubernetes.m.crossplane.io/v1alpha1']] = ( + 'kubernetes.m.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ObservedObjectCollection']] = 'ObservedObjectCollection' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ObservedObjectCollectionSpec defines the desired state of ObservedObjectCollection + """ + status: Optional[Status] = None + """ + ObservedObjectCollectionStatus represents the observed state of a ObservedObjectCollection + """ + + +class ObservedObjectCollectionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ObservedObjectCollection] + """ + List of observedobjectcollections. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/kubernetes/providerconfig/__init__.py b/schemas/python/models/io/crossplane/m/kubernetes/providerconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/kubernetes/providerconfig/v1alpha1.py b/schemas/python/models/io/crossplane/m/kubernetes/providerconfig/v1alpha1.py new file mode 100644 index 000000000..48cbde281 --- /dev/null +++ b/schemas/python/models/io/crossplane/m/kubernetes/providerconfig/v1alpha1.py @@ -0,0 +1,195 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_m_crossplane_io_v1alpha1_providerconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Env(BaseModel): + name: str + """ + Name is the name of an environment variable. + """ + + +class Fs(BaseModel): + path: str + """ + Path is a filesystem path. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credentials(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + + +class Identity(BaseModel): + env: Optional[Env] = None + """ + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + """ + fs: Optional[Fs] = None + """ + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + """ + source: Literal['None', 'Secret', 'InjectedIdentity', 'Environment', 'Filesystem'] + """ + Source of the provider credentials. + """ + type: Literal[ + 'GoogleApplicationCredentials', + 'AzureServicePrincipalCredentials', + 'AzureWorkloadIdentityCredentials', + 'UpboundTokens', + 'AWSWebIdentityCredentials', + ] + """ + Type of identity. + """ + + +class Spec(BaseModel): + credentials: Credentials + """ + Credentials used to connect to the Kubernetes API. Typically a + kubeconfig file. Use InjectedIdentity for in-cluster config. + """ + identity: Optional[Identity] = None + """ + Identity used to authenticate to the Kubernetes API. The identity + credentials can be used to supplement kubeconfig 'credentials', for + example by configuring a bearer token source such as OAuth. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + users: Optional[int] = None + """ + Users of this provider configuration. + """ + + +class ProviderConfig(BaseModel): + apiVersion: Optional[Literal['kubernetes.m.crossplane.io/v1alpha1']] = ( + 'kubernetes.m.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ProviderConfig']] = 'ProviderConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + A ProviderConfigSpec defines the desired state of a ProviderConfig. + """ + status: Optional[Status] = None + """ + A ProviderConfigStatus reflects the observed state of a ProviderConfig. + """ + + +class ProviderConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfig] + """ + List of providerconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/m/kubernetes/providerconfigusage/__init__.py b/schemas/python/models/io/crossplane/m/kubernetes/providerconfigusage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/m/kubernetes/providerconfigusage/v1alpha1.py b/schemas/python/models/io/crossplane/m/kubernetes/providerconfigusage/v1alpha1.py new file mode 100644 index 000000000..8027f6d46 --- /dev/null +++ b/schemas/python/models/io/crossplane/m/kubernetes/providerconfigusage/v1alpha1.py @@ -0,0 +1,84 @@ +# generated by datamodel-codegen: +# filename: workdir/kubernetes_m_crossplane_io_v1alpha1_providerconfigusage.yaml + +from __future__ import annotations + +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class ResourceRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class ProviderConfigUsage(BaseModel): + apiVersion: Optional[Literal['kubernetes.m.crossplane.io/v1alpha1']] = ( + 'kubernetes.m.crossplane.io/v1alpha1' + ) + """ + 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[Literal['ProviderConfigUsage']] = 'ProviderConfigUsage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + providerConfigRef: ProviderConfigRef + """ + ProviderConfigReference to the provider config being used. + """ + resourceRef: ResourceRef + """ + ResourceReference to the managed resource using the provider config. + """ + + +class ProviderConfigUsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderConfigUsage] + """ + List of providerconfigusages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/ops/__init__.py b/schemas/python/models/io/crossplane/ops/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/ops/cronoperation/__init__.py b/schemas/python/models/io/crossplane/ops/cronoperation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/ops/cronoperation/v1alpha1.py b/schemas/python/models/io/crossplane/ops/cronoperation/v1alpha1.py new file mode 100644 index 000000000..d5750f281 --- /dev/null +++ b/schemas/python/models/io/crossplane/ops/cronoperation/v1alpha1.py @@ -0,0 +1,296 @@ +# generated by datamodel-codegen: +# filename: workdir/ops_crossplane_io_v1alpha1_cronoperation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class SecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credential(BaseModel): + name: str + """ + Name of this set of credentials. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret containing credentials that should + be supplied to the function. + """ + source: Literal['None', 'Secret'] + """ + Source of the function credentials. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced function. + """ + + +class RequiredResource(BaseModel): + apiVersion: str + """ + APIVersion of resources to select. + """ + kind: str + """ + Kind of resources to select. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels matches resources by label selector. Only one of Name or + MatchLabels may be specified. + """ + name: Optional[str] = None + """ + Name matches a single resource by name. Only one of Name or + MatchLabels may be specified. + """ + namespace: Optional[str] = None + """ + Namespace to search for resources. Optional for cluster-scoped resources. + """ + requirementName: str + """ + RequirementName uniquely identifies this group of resources. + This name will be used as the key in RunFunctionRequest.required_resources. + """ + + +class RequiredSchema(BaseModel): + apiVersion: str + """ + APIVersion of the resource kind whose schema is required, e.g. "example.org/v1". + """ + kind: str + """ + Kind of resource whose schema is required, e.g. "MyResource". + """ + requirementName: str + """ + RequirementName uniquely identifies this schema. + This name will be used as the key in RunFunctionRequest.required_schemas. + """ + + +class Requirements(BaseModel): + requiredResources: Optional[List[RequiredResource]] = None + """ + RequiredResources that will be fetched before this pipeline step + is called for the first time. + """ + requiredSchemas: Optional[List[RequiredSchema]] = None + """ + RequiredSchemas that will be fetched before this pipeline step + is called for the first time. + """ + + +class PipelineItem(BaseModel): + credentials: Optional[List[Credential]] = None + """ + Credentials are optional credentials that the operation function needs. + """ + functionRef: FunctionRef + """ + FunctionRef is a reference to the function this step should + execute. + """ + input: Optional[Dict[str, Any]] = None + """ + Input is an optional, arbitrary Kubernetes resource (i.e. a resource + with an apiVersion and kind) that will be passed to the unction as + the 'input' of its RunFunctionRequest. + """ + requirements: Optional[Requirements] = None + """ + Requirements are resource requirements that will be satisfied before + this pipeline step is called for the first time. This allows + pre-populating required resources without requiring a function to + request them first. + """ + step: str + """ + Step name. Must be unique within its Pipeline. + """ + + +class Spec(BaseModel): + mode: Literal['Pipeline'] = 'Pipeline' + """ + Mode controls what type or "mode" of operation will be used. + + "Pipeline" indicates that an Operation specifies a pipeline of + functions, each of which is responsible for implementing its logic. + """ + pipeline: List[PipelineItem] = Field(..., max_length=99, min_length=1) + """ + Pipeline is a list of operation function steps that will be used when + this operation runs. + """ + retryLimit: Optional[int] = None + """ + RetryLimit configures how many times the operation may fail. When the + failure limit is exceeded, the operation will not be retried. + """ + + +class OperationTemplate(BaseModel): + metadata: Optional[Dict[str, Any]] = None + """ + Standard object metadata. + """ + spec: Spec + """ + Spec is the specification of the Operation to be created. + """ + + +class SpecModel(BaseModel): + concurrencyPolicy: Optional[Literal['Allow', 'Forbid', 'Replace']] = 'Allow' + """ + ConcurrencyPolicy specifies how to treat concurrent executions of an + operation. + """ + failedHistoryLimit: Optional[int] = 1 + """ + FailedHistoryLimit is the number of failed Operations to retain. + """ + operationTemplate: OperationTemplate + """ + OperationTemplate is the template for the Operation to be created. + """ + schedule: str + """ + Schedule is the cron schedule for the operation. + """ + startingDeadlineSeconds: Optional[int] = None + """ + StartingDeadlineSeconds is the deadline in seconds for starting the + operation if it misses its scheduled time for any reason. + """ + successfulHistoryLimit: Optional[int] = 3 + """ + SuccessfulHistoryLimit is the number of successful Operations to retain. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class RunningOperationRef(BaseModel): + name: str + """ + Name of the active operation. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + lastScheduleTime: Optional[datetime] = None + """ + LastScheduleTime is the last time the CronOperation was scheduled. + """ + lastSuccessfulTime: Optional[datetime] = None + """ + LastSuccessfulTime is the last time the CronOperation was successfully + completed. + """ + runningOperationRefs: Optional[List[RunningOperationRef]] = None + """ + RunningOperationRefs is a list of currently running Operations. + """ + + +class CronOperation(BaseModel): + apiVersion: Optional[Literal['ops.crossplane.io/v1alpha1']] = ( + 'ops.crossplane.io/v1alpha1' + ) + """ + 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[Literal['CronOperation']] = 'CronOperation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[SpecModel] = None + """ + CronOperationSpec specifies the desired state of a CronOperation. + """ + status: Optional[Status] = None + """ + CronOperationStatus represents the observed state of a CronOperation. + """ + + +class CronOperationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[CronOperation] + """ + List of cronoperations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/ops/operation/__init__.py b/schemas/python/models/io/crossplane/ops/operation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/ops/operation/v1alpha1.py b/schemas/python/models/io/crossplane/ops/operation/v1alpha1.py new file mode 100644 index 000000000..c910facd9 --- /dev/null +++ b/schemas/python/models/io/crossplane/ops/operation/v1alpha1.py @@ -0,0 +1,279 @@ +# generated by datamodel-codegen: +# filename: workdir/ops_crossplane_io_v1alpha1_operation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class SecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credential(BaseModel): + name: str + """ + Name of this set of credentials. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret containing credentials that should + be supplied to the function. + """ + source: Literal['None', 'Secret'] + """ + Source of the function credentials. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced function. + """ + + +class RequiredResource(BaseModel): + apiVersion: str + """ + APIVersion of resources to select. + """ + kind: str + """ + Kind of resources to select. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels matches resources by label selector. Only one of Name or + MatchLabels may be specified. + """ + name: Optional[str] = None + """ + Name matches a single resource by name. Only one of Name or + MatchLabels may be specified. + """ + namespace: Optional[str] = None + """ + Namespace to search for resources. Optional for cluster-scoped resources. + """ + requirementName: str + """ + RequirementName uniquely identifies this group of resources. + This name will be used as the key in RunFunctionRequest.required_resources. + """ + + +class RequiredSchema(BaseModel): + apiVersion: str + """ + APIVersion of the resource kind whose schema is required, e.g. "example.org/v1". + """ + kind: str + """ + Kind of resource whose schema is required, e.g. "MyResource". + """ + requirementName: str + """ + RequirementName uniquely identifies this schema. + This name will be used as the key in RunFunctionRequest.required_schemas. + """ + + +class Requirements(BaseModel): + requiredResources: Optional[List[RequiredResource]] = None + """ + RequiredResources that will be fetched before this pipeline step + is called for the first time. + """ + requiredSchemas: Optional[List[RequiredSchema]] = None + """ + RequiredSchemas that will be fetched before this pipeline step + is called for the first time. + """ + + +class PipelineItem(BaseModel): + credentials: Optional[List[Credential]] = None + """ + Credentials are optional credentials that the operation function needs. + """ + functionRef: FunctionRef + """ + FunctionRef is a reference to the function this step should + execute. + """ + input: Optional[Dict[str, Any]] = None + """ + Input is an optional, arbitrary Kubernetes resource (i.e. a resource + with an apiVersion and kind) that will be passed to the unction as + the 'input' of its RunFunctionRequest. + """ + requirements: Optional[Requirements] = None + """ + Requirements are resource requirements that will be satisfied before + this pipeline step is called for the first time. This allows + pre-populating required resources without requiring a function to + request them first. + """ + step: str + """ + Step name. Must be unique within its Pipeline. + """ + + +class Spec(BaseModel): + mode: Literal['Pipeline'] = 'Pipeline' + """ + Mode controls what type or "mode" of operation will be used. + + "Pipeline" indicates that an Operation specifies a pipeline of + functions, each of which is responsible for implementing its logic. + """ + pipeline: List[PipelineItem] = Field(..., max_length=99, min_length=1) + """ + Pipeline is a list of operation function steps that will be used when + this operation runs. + """ + retryLimit: Optional[int] = None + """ + RetryLimit configures how many times the operation may fail. When the + failure limit is exceeded, the operation will not be retried. + """ + + +class AppliedResourceRef(BaseModel): + apiVersion: str + """ + APIVersion of the applied resource. + """ + kind: str + """ + Kind of the applied resource. + """ + name: str + """ + Name of the applied resource. + """ + namespace: Optional[str] = None + """ + Namespace of the applied resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class PipelineItemModel(BaseModel): + output: Optional[Dict[str, Any]] = None + """ + Output of this step. + """ + step: str + """ + Step name. Unique within its Pipeline. + """ + + +class Status(BaseModel): + appliedResourceRefs: Optional[List[AppliedResourceRef]] = None + """ + AppliedResourceRefs references all resources the Operation applied. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + failures: Optional[int] = None + """ + Number of operation failures. + """ + pipeline: Optional[List[PipelineItemModel]] = None + """ + Pipeline represents the output of the pipeline steps that this operation + ran. + """ + + +class Operation(BaseModel): + apiVersion: Optional[Literal['ops.crossplane.io/v1alpha1']] = ( + 'ops.crossplane.io/v1alpha1' + ) + """ + 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[Literal['Operation']] = 'Operation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + OperationSpec specifies desired state of an operation. + """ + status: Optional[Status] = None + """ + OperationStatus represents the observed state of an operation. + """ + + +class OperationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Operation] + """ + List of operations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/ops/watchoperation/__init__.py b/schemas/python/models/io/crossplane/ops/watchoperation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/ops/watchoperation/v1alpha1.py b/schemas/python/models/io/crossplane/ops/watchoperation/v1alpha1.py new file mode 100644 index 000000000..5f8c8ee03 --- /dev/null +++ b/schemas/python/models/io/crossplane/ops/watchoperation/v1alpha1.py @@ -0,0 +1,318 @@ +# generated by datamodel-codegen: +# filename: workdir/ops_crossplane_io_v1alpha1_watchoperation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class SecretRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Credential(BaseModel): + name: str + """ + Name of this set of credentials. + """ + secretRef: Optional[SecretRef] = None + """ + A SecretRef is a reference to a secret containing credentials that should + be supplied to the function. + """ + source: Literal['None', 'Secret'] + """ + Source of the function credentials. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced function. + """ + + +class RequiredResource(BaseModel): + apiVersion: str + """ + APIVersion of resources to select. + """ + kind: str + """ + Kind of resources to select. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels matches resources by label selector. Only one of Name or + MatchLabels may be specified. + """ + name: Optional[str] = None + """ + Name matches a single resource by name. Only one of Name or + MatchLabels may be specified. + """ + namespace: Optional[str] = None + """ + Namespace to search for resources. Optional for cluster-scoped resources. + """ + requirementName: str + """ + RequirementName uniquely identifies this group of resources. + This name will be used as the key in RunFunctionRequest.required_resources. + """ + + +class RequiredSchema(BaseModel): + apiVersion: str + """ + APIVersion of the resource kind whose schema is required, e.g. "example.org/v1". + """ + kind: str + """ + Kind of resource whose schema is required, e.g. "MyResource". + """ + requirementName: str + """ + RequirementName uniquely identifies this schema. + This name will be used as the key in RunFunctionRequest.required_schemas. + """ + + +class Requirements(BaseModel): + requiredResources: Optional[List[RequiredResource]] = None + """ + RequiredResources that will be fetched before this pipeline step + is called for the first time. + """ + requiredSchemas: Optional[List[RequiredSchema]] = None + """ + RequiredSchemas that will be fetched before this pipeline step + is called for the first time. + """ + + +class PipelineItem(BaseModel): + credentials: Optional[List[Credential]] = None + """ + Credentials are optional credentials that the operation function needs. + """ + functionRef: FunctionRef + """ + FunctionRef is a reference to the function this step should + execute. + """ + input: Optional[Dict[str, Any]] = None + """ + Input is an optional, arbitrary Kubernetes resource (i.e. a resource + with an apiVersion and kind) that will be passed to the unction as + the 'input' of its RunFunctionRequest. + """ + requirements: Optional[Requirements] = None + """ + Requirements are resource requirements that will be satisfied before + this pipeline step is called for the first time. This allows + pre-populating required resources without requiring a function to + request them first. + """ + step: str + """ + Step name. Must be unique within its Pipeline. + """ + + +class Spec(BaseModel): + mode: Literal['Pipeline'] = 'Pipeline' + """ + Mode controls what type or "mode" of operation will be used. + + "Pipeline" indicates that an Operation specifies a pipeline of + functions, each of which is responsible for implementing its logic. + """ + pipeline: List[PipelineItem] = Field(..., max_length=99, min_length=1) + """ + Pipeline is a list of operation function steps that will be used when + this operation runs. + """ + retryLimit: Optional[int] = None + """ + RetryLimit configures how many times the operation may fail. When the + failure limit is exceeded, the operation will not be retried. + """ + + +class OperationTemplate(BaseModel): + metadata: Optional[Dict[str, Any]] = None + """ + Standard object metadata. + """ + spec: Spec + """ + Spec is the specification of the Operation to be created. + """ + + +class Watch(BaseModel): + apiVersion: str + """ + APIVersion of the resource to watch. + """ + kind: str + """ + Kind of the resource to watch. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels selects resources by label. If empty, all resources of the + specified kind are watched. + """ + namespace: Optional[str] = None + """ + Namespace selects resources in a specific namespace. If empty, all + namespaces are watched. Only applicable for namespaced resources. + """ + + +class SpecModel(BaseModel): + concurrencyPolicy: Optional[Literal['Allow', 'Forbid', 'Replace']] = 'Allow' + """ + ConcurrencyPolicy specifies how to treat concurrent executions of an + operation. + """ + failedHistoryLimit: Optional[int] = 1 + """ + FailedHistoryLimit is the number of failed Operations to retain. + """ + operationTemplate: OperationTemplate + """ + OperationTemplate is the template for the Operation to be created. + """ + successfulHistoryLimit: Optional[int] = 3 + """ + SuccessfulHistoryLimit is the number of successful Operations to retain. + """ + watch: Watch + """ + Watch specifies the resource to watch. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class RunningOperationRef(BaseModel): + name: str + """ + Name of the active operation. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + lastScheduleTime: Optional[datetime] = None + """ + LastScheduleTime is the last time the WatchOperation created an + Operation. + """ + lastSuccessfulTime: Optional[datetime] = None + """ + LastSuccessfulTime is the last time the WatchOperation successfully + completed an Operation. + """ + runningOperationRefs: Optional[List[RunningOperationRef]] = None + """ + RunningOperationRefs is a list of currently running Operations. + """ + watchingResources: Optional[int] = None + """ + WatchingResources is the number of resources this WatchOperation is + currently watching. + """ + + +class WatchOperation(BaseModel): + apiVersion: Optional[Literal['ops.crossplane.io/v1alpha1']] = ( + 'ops.crossplane.io/v1alpha1' + ) + """ + 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[Literal['WatchOperation']] = 'WatchOperation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[SpecModel] = None + """ + WatchOperationSpec specifies the desired state of a WatchOperation. + """ + status: Optional[Status] = None + """ + WatchOperationStatus represents the observed state of a WatchOperation. + """ + + +class WatchOperationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[WatchOperation] + """ + List of watchoperations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/__init__.py b/schemas/python/models/io/crossplane/pkg/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/configuration/__init__.py b/schemas/python/models/io/crossplane/pkg/configuration/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/configuration/v1.py b/schemas/python/models/io/crossplane/pkg/configuration/v1.py new file mode 100644 index 000000000..e65e7ae22 --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/configuration/v1.py @@ -0,0 +1,192 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1_configuration.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + package: str + """ + Package is the name of the package that is being requested. + must be a fully qualified image name, including the registry, + repository, and tag. for example, "registry.example.com/repo/package:tag". + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be used + to fetch packages from private registries. + """ + revisionActivationPolicy: Optional[str] = 'Automatic' + """ + RevisionActivationPolicy specifies how the package controller should + update from one revision to the next. Options are Automatic or Manual. + Default is Automatic. + """ + revisionHistoryLimit: Optional[int] = 1 + """ + RevisionHistoryLimit dictates how the package controller cleans up old + inactive package revisions. + Defaults to 1. Can be disabled by explicitly setting to 0. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this package, and what they were used for. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + currentIdentifier: Optional[str] = None + """ + CurrentIdentifier is the most recent package source that was used to + produce a revision. The package manager uses this field to determine + whether to check for package updates for a given source when + packagePullPolicy is set to IfNotPresent. Manually removing this field + will cause the package manager to check that the current revision is + correct for the given package source. + """ + currentRevision: Optional[str] = None + """ + CurrentRevision is the name of the current package revision. It will + reflect the most up to date revision, whether it has been activated or + not. + """ + resolvedPackage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was used for version + resolution. It may be different from spec.package if the package path was + rewritten using an image config. + """ + + +class Configuration(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1']] = 'pkg.crossplane.io/v1' + """ + 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[Literal['Configuration']] = 'Configuration' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + ConfigurationSpec specifies details about a request to install a + configuration to Crossplane. + """ + status: Optional[Status] = None + """ + ConfigurationStatus represents the observed state of a Configuration. + """ + + +class ConfigurationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Configuration] + """ + List of configurations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/configurationrevision/__init__.py b/schemas/python/models/io/crossplane/pkg/configurationrevision/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/configurationrevision/v1.py b/schemas/python/models/io/crossplane/pkg/configurationrevision/v1.py new file mode 100644 index 000000000..0b517b164 --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/configurationrevision/v1.py @@ -0,0 +1,208 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1_configurationrevision.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + desiredState: str + """ + DesiredState of the PackageRevision. Can be either Active or Inactive. + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + image: str + """ + Package image used by install Pod to extract package contents. + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. It is also + applied to any images pulled for the package, such as a provider's + controller image. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be + used to fetch packages from private registries. They are also applied to + any images pulled for the package, such as a provider's controller image. + """ + revision: int + """ + Revision number. Indicates when the revision will be garbage collected + based on the parent's RevisionHistoryLimit. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class ObjectRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this revision, and what they were used for. + """ + capabilities: Optional[List[str]] = None + """ + Capabilities of this package. Capabilities are opaque strings that + may be meaningful to package consumers. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + foundDependencies: Optional[int] = None + """ + Dependency information. + """ + installedDependencies: Optional[int] = None + invalidDependencies: Optional[int] = None + objectRefs: Optional[List[ObjectRef]] = None + """ + References to objects owned by PackageRevision. + """ + resolvedImage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was installed. It may be + different from spec.image if the package path was rewritten using an + image config. + """ + + +class ConfigurationRevision(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1']] = 'pkg.crossplane.io/v1' + """ + 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[Literal['ConfigurationRevision']] = 'ConfigurationRevision' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + PackageRevisionSpec specifies the desired state of a PackageRevision. + """ + status: Optional[Status] = None + """ + PackageRevisionStatus represents the observed state of a PackageRevision. + """ + + +class ConfigurationRevisionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ConfigurationRevision] + """ + List of configurationrevisions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/deploymentruntimeconfig/__init__.py b/schemas/python/models/io/crossplane/pkg/deploymentruntimeconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/deploymentruntimeconfig/v1beta1.py b/schemas/python/models/io/crossplane/pkg/deploymentruntimeconfig/v1beta1.py new file mode 100644 index 000000000..bfbc057c2 --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/deploymentruntimeconfig/v1beta1.py @@ -0,0 +1,4735 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1beta1_deploymentruntimeconfig.yaml + +from __future__ import annotations + +from typing import Dict, List, Literal, Optional, Union + +from pydantic import BaseModel, RootModel, constr + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + 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:https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + """ + labels: Optional[Dict[str, str]] = None + """ + Map of string keys and values that can be used to organize and categorize + (scope and select) objects. Labels will be merged with internal labels + used by crossplane, and labels with a crossplane.io key might be + overwritten. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + name: Optional[str] = None + """ + Name is the name of the object. + """ + + +class MatchExpression(BaseModel): + key: str + """ + key is the label key that the selector applies to. + """ + operator: str + """ + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + """ + values: Optional[List[str]] = None + """ + 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 Selector(BaseModel): + matchExpressions: Optional[List[MatchExpression]] = None + """ + matchExpressions is a list of label selector requirements. The requirements are ANDed. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + 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 RollingUpdate(BaseModel): + maxSurge: Optional[Union[int, str]] = None + """ + The maximum number of pods that can be scheduled above the desired number of + pods. + Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). + This can not be 0 if MaxUnavailable is 0. + Absolute number is calculated from percentage by rounding up. + Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when + the rolling update starts, such that the total number of old and new pods do not exceed + 130% of desired pods. Once old pods have been killed, + new ReplicaSet can be scaled up further, ensuring that total number of pods running + at any time during the update is at most 130% of desired pods. + """ + maxUnavailable: Optional[Union[int, str]] = None + """ + The maximum number of pods that can be unavailable during the update. + Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). + Absolute number is calculated from percentage by rounding down. + This can not be 0 if MaxSurge is 0. + Defaults to 25%. + Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods + immediately when the rolling update starts. Once new pods are ready, old ReplicaSet + can be scaled down further, followed by scaling up the new ReplicaSet, ensuring + that the total number of pods available at all times during the update is at + least 70% of desired pods. + """ + + +class Strategy(BaseModel): + rollingUpdate: Optional[RollingUpdate] = None + """ + Rolling update config params. Present only if DeploymentStrategyType = + RollingUpdate. + """ + type: Optional[str] = None + """ + Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. + """ + + +class MetadataModel(BaseModel): + annotations: Optional[Dict[str, str]] = None + finalizers: Optional[List[str]] = None + labels: Optional[Dict[str, str]] = None + name: Optional[str] = None + namespace: Optional[str] = None + + +class MatchExpressionModel(BaseModel): + key: str + """ + The label key that the selector applies to. + """ + operator: str + """ + Represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + """ + values: Optional[List[str]] = None + """ + 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. + """ + + +class MatchField(BaseModel): + key: str + """ + The label key that the selector applies to. + """ + operator: str + """ + Represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + """ + values: Optional[List[str]] = None + """ + 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. + """ + + +class Preference(BaseModel): + matchExpressions: Optional[List[MatchExpressionModel]] = None + """ + A list of node selector requirements by node's labels. + """ + matchFields: Optional[List[MatchField]] = None + """ + A list of node selector requirements by node's fields. + """ + + +class PreferredDuringSchedulingIgnoredDuringExecutionItem(BaseModel): + preference: Preference + """ + A node selector term, associated with the corresponding weight. + """ + weight: int + """ + Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + """ + + +class NodeSelectorTerm(BaseModel): + matchExpressions: Optional[List[MatchExpressionModel]] = None + """ + A list of node selector requirements by node's labels. + """ + matchFields: Optional[List[MatchField]] = None + """ + A list of node selector requirements by node's fields. + """ + + +class RequiredDuringSchedulingIgnoredDuringExecution(BaseModel): + nodeSelectorTerms: List[NodeSelectorTerm] + """ + Required. A list of node selector terms. The terms are ORed. + """ + + +class NodeAffinity(BaseModel): + preferredDuringSchedulingIgnoredDuringExecution: Optional[ + List[PreferredDuringSchedulingIgnoredDuringExecutionItem] + ] = None + """ + 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. + """ + requiredDuringSchedulingIgnoredDuringExecution: Optional[ + RequiredDuringSchedulingIgnoredDuringExecution + ] = None + """ + 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. + """ + + +class MatchExpressionModel1(BaseModel): + key: str + """ + key is the label key that the selector applies to. + """ + operator: str + """ + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + """ + values: Optional[List[str]] = None + """ + 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 LabelSelector(BaseModel): + matchExpressions: Optional[List[MatchExpressionModel1]] = None + """ + matchExpressions is a list of label selector requirements. The requirements are ANDed. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + 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 NamespaceSelector(BaseModel): + matchExpressions: Optional[List[MatchExpressionModel1]] = None + """ + matchExpressions is a list of label selector requirements. The requirements are ANDed. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + 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 PodAffinityTerm(BaseModel): + labelSelector: Optional[LabelSelector] = None + """ + A label query over a set of resources, in this case pods. + If it's null, this PodAffinityTerm matches with no Pods. + """ + matchLabelKeys: Optional[List[str]] = None + """ + MatchLabelKeys is a set of pod label keys to select which pods will + be taken into consideration. The keys are used to lookup values from the + incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` + to select the group of existing pods which pods will be taken into consideration + for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming + pod labels will be ignored. The default value is empty. + The same key is forbidden to exist in both matchLabelKeys and labelSelector. + Also, matchLabelKeys cannot be set when labelSelector isn't set. + """ + mismatchLabelKeys: Optional[List[str]] = None + """ + MismatchLabelKeys is a set of pod label keys to select which pods will + be taken into consideration. The keys are used to lookup values from the + incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` + to select the group of existing pods which pods will be taken into consideration + for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming + pod labels will be ignored. The default value is empty. + The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. + Also, mismatchLabelKeys cannot be set when labelSelector isn't set. + """ + namespaceSelector: Optional[NamespaceSelector] = None + """ + 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. + """ + namespaces: Optional[List[str]] = None + """ + 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". + """ + topologyKey: str + """ + 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 PreferredDuringSchedulingIgnoredDuringExecutionItemModel(BaseModel): + podAffinityTerm: PodAffinityTerm + """ + Required. A pod affinity term, associated with the corresponding weight. + """ + weight: int + """ + weight associated with matching the corresponding podAffinityTerm, + in the range 1-100. + """ + + +class RequiredDuringSchedulingIgnoredDuringExecutionItem(BaseModel): + labelSelector: Optional[LabelSelector] = None + """ + A label query over a set of resources, in this case pods. + If it's null, this PodAffinityTerm matches with no Pods. + """ + matchLabelKeys: Optional[List[str]] = None + """ + MatchLabelKeys is a set of pod label keys to select which pods will + be taken into consideration. The keys are used to lookup values from the + incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` + to select the group of existing pods which pods will be taken into consideration + for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming + pod labels will be ignored. The default value is empty. + The same key is forbidden to exist in both matchLabelKeys and labelSelector. + Also, matchLabelKeys cannot be set when labelSelector isn't set. + """ + mismatchLabelKeys: Optional[List[str]] = None + """ + MismatchLabelKeys is a set of pod label keys to select which pods will + be taken into consideration. The keys are used to lookup values from the + incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` + to select the group of existing pods which pods will be taken into consideration + for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming + pod labels will be ignored. The default value is empty. + The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. + Also, mismatchLabelKeys cannot be set when labelSelector isn't set. + """ + namespaceSelector: Optional[NamespaceSelector] = None + """ + 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. + """ + namespaces: Optional[List[str]] = None + """ + 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". + """ + topologyKey: str + """ + 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 PodAffinity(BaseModel): + preferredDuringSchedulingIgnoredDuringExecution: Optional[ + List[PreferredDuringSchedulingIgnoredDuringExecutionItemModel] + ] = None + """ + 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. + """ + requiredDuringSchedulingIgnoredDuringExecution: Optional[ + List[RequiredDuringSchedulingIgnoredDuringExecutionItem] + ] = None + """ + 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. + """ + + +class PodAntiAffinity(BaseModel): + preferredDuringSchedulingIgnoredDuringExecution: Optional[ + List[PreferredDuringSchedulingIgnoredDuringExecutionItemModel] + ] = None + """ + 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 subtracting + "weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + """ + requiredDuringSchedulingIgnoredDuringExecution: Optional[ + List[RequiredDuringSchedulingIgnoredDuringExecutionItem] + ] = None + """ + 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. + """ + + +class Affinity(BaseModel): + nodeAffinity: Optional[NodeAffinity] = None + """ + Describes node affinity scheduling rules for the pod. + """ + podAffinity: Optional[PodAffinity] = None + """ + Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). + """ + podAntiAffinity: Optional[PodAntiAffinity] = None + """ + Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). + """ + + +class ConfigMapKeyRef(BaseModel): + key: str + """ + The key to select. + """ + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + optional: Optional[bool] = None + """ + Specify whether the ConfigMap or its key must be defined + """ + + +class FieldRef(BaseModel): + apiVersion: Optional[str] = None + """ + Version of the schema the FieldPath is written in terms of, defaults to "v1". + """ + fieldPath: str + """ + Path of the field to select in the specified API version. + """ + + +class FileKeyRef(BaseModel): + key: str + """ + The key within the env file. An invalid key will prevent the pod from starting. + The keys defined within a source may consist of any printable ASCII characters except '='. + During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters. + """ + optional: Optional[bool] = False + """ + Specify whether the file or its key must be defined. If the file or key + does not exist, then the env var is not published. + If optional is set to true and the specified key does not exist, + the environment variable will not be set in the Pod's containers. + + If optional is set to false and the specified key does not exist, + an error will be returned during Pod creation. + """ + path: str + """ + The path within the volume from which to select the file. + Must be relative and may not contain the '..' path or start with '..'. + """ + volumeName: str + """ + The name of the volume mount containing the env file. + """ + + +class Divisor(RootModel[int]): + root: int + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class DivisorModel( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class ResourceFieldRef(BaseModel): + containerName: Optional[str] = None + """ + Container name: required for volumes, optional for env vars + """ + divisor: Optional[Union[Divisor, DivisorModel]] = None + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + resource: str + """ + Required: resource to select + """ + + +class SecretKeyRef(BaseModel): + key: str + """ + The key of the secret to select from. Must be a valid secret key. + """ + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + optional: Optional[bool] = None + """ + Specify whether the Secret or its key must be defined + """ + + +class ValueFrom(BaseModel): + configMapKeyRef: Optional[ConfigMapKeyRef] = None + """ + Selects a key of a ConfigMap. + """ + fieldRef: Optional[FieldRef] = None + """ + 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. + """ + fileKeyRef: Optional[FileKeyRef] = None + """ + FileKeyRef selects a key of the env file. + Requires the EnvFiles feature gate to be enabled. + """ + resourceFieldRef: Optional[ResourceFieldRef] = None + """ + 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. + """ + secretKeyRef: Optional[SecretKeyRef] = None + """ + Selects a key of a secret in the pod's namespace + """ + + +class EnvItem(BaseModel): + name: str + """ + Name of the environment variable. + May consist of any printable ASCII characters except '='. + """ + value: Optional[str] = None + """ + 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 "". + """ + valueFrom: Optional[ValueFrom] = None + """ + Source for the environment variable's value. Cannot be used if value is not empty. + """ + + +class ConfigMapRef(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + optional: Optional[bool] = None + """ + Specify whether the ConfigMap must be defined + """ + + +class SecretRef(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + optional: Optional[bool] = None + """ + Specify whether the Secret must be defined + """ + + +class EnvFromItem(BaseModel): + configMapRef: Optional[ConfigMapRef] = None + """ + The ConfigMap to select from + """ + prefix: Optional[str] = None + """ + Optional text to prepend to the name of each environment variable. + May consist of any printable ASCII characters except '='. + """ + secretRef: Optional[SecretRef] = None + """ + The Secret to select from + """ + + +class Exec(BaseModel): + command: Optional[List[str]] = None + """ + 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. + """ + + +class HttpHeader(BaseModel): + name: str + """ + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. + """ + value: str + """ + The header field value + """ + + +class HttpGet(BaseModel): + host: Optional[str] = None + """ + Host name to connect to, defaults to the pod IP. You probably want to set + "Host" in httpHeaders instead. + """ + httpHeaders: Optional[List[HttpHeader]] = None + """ + Custom headers to set in the request. HTTP allows repeated headers. + """ + path: Optional[str] = None + """ + Path to access on the HTTP server. + """ + port: Union[int, str] + """ + 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[str] = None + """ + Scheme to use for connecting to the host. + Defaults to HTTP. + """ + + +class Sleep(BaseModel): + seconds: int + """ + Seconds is the number of seconds to sleep. + """ + + +class TcpSocket(BaseModel): + host: Optional[str] = None + """ + Optional: Host name to connect to, defaults to the pod IP. + """ + port: Union[int, str] + """ + 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 PostStart(BaseModel): + exec: Optional[Exec] = None + """ + Exec specifies a command to execute in the container. + """ + httpGet: Optional[HttpGet] = None + """ + HTTPGet specifies an HTTP GET request to perform. + """ + sleep: Optional[Sleep] = None + """ + Sleep represents a duration that the container should sleep. + """ + tcpSocket: Optional[TcpSocket] = None + """ + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for backward compatibility. There is no validation of this field and + lifecycle hooks will fail at runtime when it is specified. + """ + + +class PreStop(BaseModel): + exec: Optional[Exec] = None + """ + Exec specifies a command to execute in the container. + """ + httpGet: Optional[HttpGet] = None + """ + HTTPGet specifies an HTTP GET request to perform. + """ + sleep: Optional[Sleep] = None + """ + Sleep represents a duration that the container should sleep. + """ + tcpSocket: Optional[TcpSocket] = None + """ + Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + for backward compatibility. There is no validation of this field and + lifecycle hooks will fail at runtime when it is specified. + """ + + +class Lifecycle(BaseModel): + postStart: Optional[PostStart] = None + """ + 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 + """ + preStop: Optional[PreStop] = None + """ + 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 + """ + stopSignal: Optional[str] = None + """ + StopSignal defines which signal will be sent to a container when it is being stopped. + If not specified, the default is defined by the container runtime in use. + StopSignal can only be set for Pods with a non-empty .spec.os.name + """ + + +class Grpc(BaseModel): + port: int + """ + Port number of the gRPC service. Number must be in the range 1 to 65535. + """ + service: Optional[str] = '' + """ + 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). + + If this is not specified, the default behavior is defined by gRPC. + """ + + +class LivenessProbe(BaseModel): + exec: Optional[Exec] = None + """ + Exec specifies a command to execute in the container. + """ + failureThreshold: Optional[int] = None + """ + Minimum consecutive failures for the probe to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + """ + grpc: Optional[Grpc] = None + """ + GRPC specifies a GRPC HealthCheckRequest. + """ + httpGet: Optional[HttpGet] = None + """ + HTTPGet specifies an HTTP GET request to perform. + """ + initialDelaySeconds: Optional[int] = None + """ + 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 + """ + periodSeconds: Optional[int] = None + """ + How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + """ + successThreshold: Optional[int] = None + """ + 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. + """ + tcpSocket: Optional[TcpSocket] = None + """ + TCPSocket specifies a connection to a TCP port. + """ + terminationGracePeriodSeconds: Optional[int] = None + """ + 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. + """ + timeoutSeconds: Optional[int] = None + """ + 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 + """ + + +class Port(BaseModel): + containerPort: int + """ + Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + """ + hostIP: Optional[str] = None + """ + What host IP to bind the external port to. + """ + hostPort: Optional[int] = None + """ + 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] = None + """ + 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[str] = 'TCP' + """ + Protocol for port. Must be UDP, TCP, or SCTP. + Defaults to "TCP". + """ + + +class ReadinessProbe(BaseModel): + exec: Optional[Exec] = None + """ + Exec specifies a command to execute in the container. + """ + failureThreshold: Optional[int] = None + """ + Minimum consecutive failures for the probe to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + """ + grpc: Optional[Grpc] = None + """ + GRPC specifies a GRPC HealthCheckRequest. + """ + httpGet: Optional[HttpGet] = None + """ + HTTPGet specifies an HTTP GET request to perform. + """ + initialDelaySeconds: Optional[int] = None + """ + 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 + """ + periodSeconds: Optional[int] = None + """ + How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + """ + successThreshold: Optional[int] = None + """ + 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. + """ + tcpSocket: Optional[TcpSocket] = None + """ + TCPSocket specifies a connection to a TCP port. + """ + terminationGracePeriodSeconds: Optional[int] = None + """ + 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. + """ + timeoutSeconds: Optional[int] = None + """ + 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 + """ + + +class ResizePolicyItem(BaseModel): + resourceName: str + """ + Name of the resource to which this resource resize policy applies. + Supported values: cpu, memory. + """ + restartPolicy: str + """ + Restart policy to apply when specified resource is resized. + If not specified, it defaults to NotRequired. + """ + + +class Claim(BaseModel): + name: str + """ + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. + """ + request: Optional[str] = None + """ + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + """ + + +class Limits(RootModel[int]): + root: int + + +class LimitsModel( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class Requests(RootModel[int]): + root: int + + +class RequestsModel( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class Resources(BaseModel): + claims: Optional[List[Claim]] = None + """ + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This field depends on the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. + """ + limits: Optional[Dict[str, Union[Limits, LimitsModel]]] = None + """ + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + """ + requests: Optional[Dict[str, Union[Requests, RequestsModel]]] = None + """ + 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. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + """ + + +class ExitCodes(BaseModel): + operator: str + """ + Represents the relationship between the container exit code(s) and the + specified values. Possible values are: + - In: the requirement is satisfied if the container exit code is in the + set of specified values. + - NotIn: the requirement is satisfied if the container exit code is + not in the set of specified values. + """ + values: Optional[List[int]] = None + """ + Specifies the set of values to check for container exit codes. + At most 255 elements are allowed. + """ + + +class RestartPolicyRule(BaseModel): + action: str + """ + Specifies the action taken on a container exit if the requirements + are satisfied. The only possible value is "Restart" to restart the + container. + """ + exitCodes: Optional[ExitCodes] = None + """ + Represents the exit codes to check on container exits. + """ + + +class AppArmorProfile(BaseModel): + localhostProfile: Optional[str] = None + """ + localhostProfile indicates a profile loaded on the node that should be used. + The profile must be preconfigured on the node to work. + Must match the loaded name of the profile. + Must be set if and only if type is "Localhost". + """ + type: str + """ + type indicates which kind of AppArmor profile will be applied. + Valid options are: + Localhost - a profile pre-loaded on the node. + RuntimeDefault - the container runtime's default profile. + Unconfined - no AppArmor enforcement. + """ + + +class Capabilities(BaseModel): + add: Optional[List[str]] = None + """ + Added capabilities + """ + drop: Optional[List[str]] = None + """ + Removed capabilities + """ + + +class SeLinuxOptions(BaseModel): + level: Optional[str] = None + """ + Level is SELinux level label that applies to the container. + """ + role: Optional[str] = None + """ + Role is a SELinux role label that applies to the container. + """ + type: Optional[str] = None + """ + Type is a SELinux type label that applies to the container. + """ + user: Optional[str] = None + """ + User is a SELinux user label that applies to the container. + """ + + +class SeccompProfile(BaseModel): + localhostProfile: Optional[str] = None + """ + 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 be set if type is "Localhost". Must NOT be set for any other type. + """ + type: str + """ + type indicates which kind of seccomp profile will be applied. + Valid options are: + + Localhost - 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. + """ + + +class WindowsOptions(BaseModel): + gmsaCredentialSpec: Optional[str] = None + """ + 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. + """ + gmsaCredentialSpecName: Optional[str] = None + """ + GMSACredentialSpecName is the name of the GMSA credential spec to use. + """ + hostProcess: Optional[bool] = None + """ + HostProcess determines if a container should be run as a 'Host Process' container. + 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. + """ + runAsUserName: Optional[str] = None + """ + 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. + """ + + +class SecurityContext(BaseModel): + allowPrivilegeEscalation: Optional[bool] = None + """ + 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. + """ + appArmorProfile: Optional[AppArmorProfile] = None + """ + appArmorProfile is the AppArmor options to use by this container. If set, this profile + overrides the pod's appArmorProfile. + Note that this field cannot be set when spec.os.name is windows. + """ + capabilities: Optional[Capabilities] = None + """ + 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] = None + """ + 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. + """ + procMount: Optional[str] = None + """ + procMount denotes the type of proc mount to use for the containers. + The default value is Default 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. + """ + readOnlyRootFilesystem: Optional[bool] = None + """ + 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. + """ + runAsGroup: Optional[int] = None + """ + 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. + """ + runAsNonRoot: Optional[bool] = None + """ + 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. + """ + runAsUser: Optional[int] = None + """ + 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. + """ + seLinuxOptions: Optional[SeLinuxOptions] = None + """ + 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. + """ + seccompProfile: Optional[SeccompProfile] = None + """ + 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. + """ + windowsOptions: Optional[WindowsOptions] = None + """ + 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 StartupProbe(BaseModel): + exec: Optional[Exec] = None + """ + Exec specifies a command to execute in the container. + """ + failureThreshold: Optional[int] = None + """ + Minimum consecutive failures for the probe to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + """ + grpc: Optional[Grpc] = None + """ + GRPC specifies a GRPC HealthCheckRequest. + """ + httpGet: Optional[HttpGet] = None + """ + HTTPGet specifies an HTTP GET request to perform. + """ + initialDelaySeconds: Optional[int] = None + """ + 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 + """ + periodSeconds: Optional[int] = None + """ + How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + """ + successThreshold: Optional[int] = None + """ + 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. + """ + tcpSocket: Optional[TcpSocket] = None + """ + TCPSocket specifies a connection to a TCP port. + """ + terminationGracePeriodSeconds: Optional[int] = None + """ + 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. + """ + timeoutSeconds: Optional[int] = None + """ + 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 + """ + + +class VolumeDevice(BaseModel): + devicePath: str + """ + devicePath is the path inside of the container that the device will be mapped to. + """ + name: str + """ + name must match the name of a persistentVolumeClaim in the pod + """ + + +class VolumeMount(BaseModel): + mountPath: str + """ + Path within the container at which the volume should be mounted. Must + not contain ':'. + """ + mountPropagation: Optional[str] = None + """ + 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. + When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified + (which defaults to None). + """ + name: str + """ + This must match the Name of a Volume. + """ + readOnly: Optional[bool] = None + """ + Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. + """ + recursiveReadOnly: Optional[str] = None + """ + RecursiveReadOnly specifies whether read-only mounts should be handled + recursively. + + If ReadOnly is false, this field has no meaning and must be unspecified. + + If ReadOnly is true, and this field is set to Disabled, the mount is not made + recursively read-only. If this field is set to IfPossible, the mount is made + recursively read-only, if it is supported by the container runtime. If this + field is set to Enabled, the mount is made recursively read-only if it is + supported by the container runtime, otherwise the pod will not be started and + an error will be generated to indicate the reason. + + If this field is set to IfPossible or Enabled, MountPropagation must be set to + None (or be unspecified, which defaults to None). + + If this field is not specified, it is treated as an equivalent of Disabled. + """ + subPath: Optional[str] = None + """ + Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). + """ + subPathExpr: Optional[str] = None + """ + 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 Container(BaseModel): + args: Optional[List[str]] = None + """ + 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]] = None + """ + 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[EnvItem]] = None + """ + List of environment variables to set in the container. + Cannot be updated. + """ + envFrom: Optional[List[EnvFromItem]] = None + """ + List of sources to populate environment variables in the container. + The keys defined within a source may consist of any printable ASCII characters except '='. + 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] = None + """ + 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. + """ + imagePullPolicy: Optional[str] = None + """ + 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[Lifecycle] = None + """ + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. + """ + livenessProbe: Optional[LivenessProbe] = None + """ + 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 + """ + 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[Port]] = None + """ + List of ports to expose from the container. 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. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. + Cannot be updated. + """ + readinessProbe: Optional[ReadinessProbe] = None + """ + 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 + """ + resizePolicy: Optional[List[ResizePolicyItem]] = None + """ + Resources resize policy for the container. + This field cannot be set on ephemeral containers. + """ + resources: Optional[Resources] = None + """ + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + """ + restartPolicy: Optional[str] = None + """ + RestartPolicy defines the restart behavior of individual containers in a pod. + This overrides the pod-level restart policy. When this field is not specified, + the restart behavior is defined by the Pod's restart policy and the container type. + Additionally, setting the RestartPolicy as "Always" for the init container will + have the following effect: + this init container will be continually restarted on + exit until all regular containers have terminated. Once all regular + containers have completed, all init containers with restartPolicy "Always" + will be shut down. This lifecycle differs from normal init containers and + is often referred to as a "sidecar" container. Although this init + container still starts in the init container sequence, it does not wait + for the container to complete before proceeding to the next init + container. Instead, the next init container starts immediately after this + init container is started, or after any startupProbe has successfully + completed. + """ + restartPolicyRules: Optional[List[RestartPolicyRule]] = None + """ + Represents a list of rules to be checked to determine if the + container should be restarted on exit. The rules are evaluated in + order. Once a rule matches a container exit condition, the remaining + rules are ignored. If no rule matches the container exit condition, + the Container-level restart policy determines the whether the container + is restarted or not. Constraints on the rules: + - At most 20 rules are allowed. + - Rules can have the same action. + - Identical rules are not forbidden in validations. + When rules are specified, container MUST set RestartPolicy explicitly + even it if matches the Pod's RestartPolicy. + """ + securityContext: Optional[SecurityContext] = None + """ + 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/ + """ + startupProbe: Optional[StartupProbe] = None + """ + 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] = None + """ + 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. + """ + stdinOnce: Optional[bool] = None + """ + 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 + """ + terminationMessagePath: Optional[str] = None + """ + 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. + """ + terminationMessagePolicy: Optional[str] = None + """ + 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] = None + """ + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. + """ + volumeDevices: Optional[List[VolumeDevice]] = None + """ + volumeDevices is the list of block devices to be used by the container. + """ + volumeMounts: Optional[List[VolumeMount]] = None + """ + Pod volumes to mount into the container's filesystem. + Cannot be updated. + """ + workingDir: Optional[str] = None + """ + 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 Option(BaseModel): + name: Optional[str] = None + """ + Name is this DNS resolver option's name. + Required. + """ + value: Optional[str] = None + """ + Value is this DNS resolver option's value. + """ + + +class DnsConfig(BaseModel): + nameservers: Optional[List[str]] = None + """ + 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[Option]] = None + """ + 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]] = None + """ + 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 DivisorModel1(RootModel[int]): + root: int + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class DivisorModel2( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class LimitsModel1(RootModel[int]): + root: int + + +class LimitsModel2( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class RequestsModel1(RootModel[int]): + root: int + + +class RequestsModel2( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class EphemeralContainer(BaseModel): + args: Optional[List[str]] = None + """ + Arguments to the entrypoint. + The 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]] = None + """ + Entrypoint array. Not executed within a shell. + The 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[EnvItem]] = None + """ + List of environment variables to set in the container. + Cannot be updated. + """ + envFrom: Optional[List[EnvFromItem]] = None + """ + List of sources to populate environment variables in the container. + The keys defined within a source may consist of any printable ASCII characters except '='. + 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] = None + """ + Container image name. + More info: https://kubernetes.io/docs/concepts/containers/images + """ + imagePullPolicy: Optional[str] = None + """ + 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[Lifecycle] = None + """ + Lifecycle is not allowed for ephemeral containers. + """ + livenessProbe: Optional[LivenessProbe] = None + """ + Probes are not allowed for ephemeral containers. + """ + name: str + """ + Name of the ephemeral container specified as a DNS_LABEL. + This name must be unique among all containers, init containers and ephemeral containers. + """ + ports: Optional[List[Port]] = None + """ + Ports are not allowed for ephemeral containers. + """ + readinessProbe: Optional[ReadinessProbe] = None + """ + Probes are not allowed for ephemeral containers. + """ + resizePolicy: Optional[List[ResizePolicyItem]] = None + """ + Resources resize policy for the container. + """ + resources: Optional[Resources] = None + """ + Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources + already allocated to the pod. + """ + restartPolicy: Optional[str] = None + """ + Restart policy for the container to manage the restart behavior of each + container within a pod. + You cannot set this field on ephemeral containers. + """ + restartPolicyRules: Optional[List[RestartPolicyRule]] = None + """ + Represents a list of rules to be checked to determine if the + container should be restarted on exit. You cannot set this field on + ephemeral containers. + """ + securityContext: Optional[SecurityContext] = None + """ + Optional: SecurityContext defines the security options the ephemeral container should be run with. + If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + """ + startupProbe: Optional[StartupProbe] = None + """ + Probes are not allowed for ephemeral containers. + """ + stdin: Optional[bool] = None + """ + 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. + """ + stdinOnce: Optional[bool] = None + """ + 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 + """ + targetContainerName: Optional[str] = None + """ + If set, the name of the container from PodSpec that this ephemeral container targets. + The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. + If not set then the ephemeral container uses the namespaces configured in the Pod spec. + + The container runtime must implement support for this feature. If the runtime does not + support namespace targeting then the result of setting this field is undefined. + """ + terminationMessagePath: Optional[str] = None + """ + 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. + """ + terminationMessagePolicy: Optional[str] = None + """ + 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] = None + """ + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. + """ + volumeDevices: Optional[List[VolumeDevice]] = None + """ + volumeDevices is the list of block devices to be used by the container. + """ + volumeMounts: Optional[List[VolumeMount]] = None + """ + Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. + Cannot be updated. + """ + workingDir: Optional[str] = None + """ + 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 HostAliase(BaseModel): + hostnames: Optional[List[str]] = None + """ + Hostnames for the above IP address. + """ + ip: str + """ + IP address of the host file entry. + """ + + +class ImagePullSecret(BaseModel): + name: str + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class DivisorModel3(RootModel[int]): + root: int + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class DivisorModel4( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class LimitsModel3(RootModel[int]): + root: int + + +class LimitsModel4( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class RequestsModel3(RootModel[int]): + root: int + + +class RequestsModel4( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class InitContainer(BaseModel): + args: Optional[List[str]] = None + """ + 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]] = None + """ + 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[EnvItem]] = None + """ + List of environment variables to set in the container. + Cannot be updated. + """ + envFrom: Optional[List[EnvFromItem]] = None + """ + List of sources to populate environment variables in the container. + The keys defined within a source may consist of any printable ASCII characters except '='. + 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] = None + """ + 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. + """ + imagePullPolicy: Optional[str] = None + """ + 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[Lifecycle] = None + """ + Actions that the management system should take in response to container lifecycle events. + Cannot be updated. + """ + livenessProbe: Optional[LivenessProbe] = None + """ + 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 + """ + 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[Port]] = None + """ + List of ports to expose from the container. 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. + Modifying this array with strategic merge patch may corrupt the data. + For more information See https://github.com/kubernetes/kubernetes/issues/108255. + Cannot be updated. + """ + readinessProbe: Optional[ReadinessProbe] = None + """ + 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 + """ + resizePolicy: Optional[List[ResizePolicyItem]] = None + """ + Resources resize policy for the container. + This field cannot be set on ephemeral containers. + """ + resources: Optional[Resources] = None + """ + Compute Resources required by this container. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + """ + restartPolicy: Optional[str] = None + """ + RestartPolicy defines the restart behavior of individual containers in a pod. + This overrides the pod-level restart policy. When this field is not specified, + the restart behavior is defined by the Pod's restart policy and the container type. + Additionally, setting the RestartPolicy as "Always" for the init container will + have the following effect: + this init container will be continually restarted on + exit until all regular containers have terminated. Once all regular + containers have completed, all init containers with restartPolicy "Always" + will be shut down. This lifecycle differs from normal init containers and + is often referred to as a "sidecar" container. Although this init + container still starts in the init container sequence, it does not wait + for the container to complete before proceeding to the next init + container. Instead, the next init container starts immediately after this + init container is started, or after any startupProbe has successfully + completed. + """ + restartPolicyRules: Optional[List[RestartPolicyRule]] = None + """ + Represents a list of rules to be checked to determine if the + container should be restarted on exit. The rules are evaluated in + order. Once a rule matches a container exit condition, the remaining + rules are ignored. If no rule matches the container exit condition, + the Container-level restart policy determines the whether the container + is restarted or not. Constraints on the rules: + - At most 20 rules are allowed. + - Rules can have the same action. + - Identical rules are not forbidden in validations. + When rules are specified, container MUST set RestartPolicy explicitly + even it if matches the Pod's RestartPolicy. + """ + securityContext: Optional[SecurityContext] = None + """ + 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/ + """ + startupProbe: Optional[StartupProbe] = None + """ + 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] = None + """ + 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. + """ + stdinOnce: Optional[bool] = None + """ + 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 + """ + terminationMessagePath: Optional[str] = None + """ + 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. + """ + terminationMessagePolicy: Optional[str] = None + """ + 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] = None + """ + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + Default is false. + """ + volumeDevices: Optional[List[VolumeDevice]] = None + """ + volumeDevices is the list of block devices to be used by the container. + """ + volumeMounts: Optional[List[VolumeMount]] = None + """ + Pod volumes to mount into the container's filesystem. + Cannot be updated. + """ + workingDir: Optional[str] = None + """ + 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 Os(BaseModel): + name: str + """ + Name is the name of the operating system. The currently supported values are linux and windows. + Additional value may be defined in future and can be one of: + https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration + Clients should expect to handle additional values and treat unrecognized values in this field as os: null + """ + + +class Overhead(RootModel[int]): + root: int + + +class OverheadModel( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class ReadinessGate(BaseModel): + conditionType: str + """ + ConditionType refers to a condition in the pod's condition list with matching type. + """ + + +class ResourceClaim(BaseModel): + name: str + """ + Name uniquely identifies this resource claim inside the pod. + This must be a DNS_LABEL. + """ + resourceClaimName: Optional[str] = None + """ + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. + + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + """ + resourceClaimTemplateName: Optional[str] = None + """ + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. The pod name and resource name, along with a + generated component, will be used to form a unique name for the + ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + + This field is immutable and no changes will be made to the + corresponding ResourceClaim by the control plane after creating the + ResourceClaim. + + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + """ + + +class LimitsModel5(RootModel[int]): + root: int + + +class LimitsModel6( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class RequestsModel5(RootModel[int]): + root: int + + +class RequestsModel6( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class SchedulingGate(BaseModel): + name: str + """ + Name of the scheduling gate. + Each scheduling gate must have a unique name field. + """ + + +class Sysctl(BaseModel): + name: str + """ + Name of a property to set + """ + value: str + """ + Value of a property to set + """ + + +class SecurityContextModel(BaseModel): + appArmorProfile: Optional[AppArmorProfile] = None + """ + appArmorProfile is the AppArmor options to use by the containers in this pod. + Note that this field cannot be set when spec.os.name is windows. + """ + fsGroup: Optional[int] = None + """ + 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: + + 1. 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---- + + If 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. + """ + fsGroupChangePolicy: Optional[str] = None + """ + 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. + """ + runAsGroup: Optional[int] = None + """ + 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. + """ + runAsNonRoot: Optional[bool] = None + """ + 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. + """ + runAsUser: Optional[int] = None + """ + 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. + """ + seLinuxChangePolicy: Optional[str] = None + """ + seLinuxChangePolicy defines how the container's SELinux label is applied to all volumes used by the Pod. + It has no effect on nodes that do not support SELinux or to volumes does not support SELinux. + Valid values are "MountOption" and "Recursive". + + "Recursive" means relabeling of all files on all Pod volumes by the container runtime. + This may be slow for large volumes, but allows mixing privileged and unprivileged Pods sharing the same volume on the same node. + + "MountOption" mounts all eligible Pod volumes with `-o context` mount option. + This requires all Pods that share the same volume to use the same SELinux label. + It is not possible to share the same volume among privileged and unprivileged Pods. + Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes + whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their + CSIDriver instance. Other volumes are always re-labelled recursively. + "MountOption" value is allowed only when SELinuxMount feature gate is enabled. + + If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. + If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes + and "Recursive" for all other volumes. + + This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. + + All Pods that use the same volume should use the same seLinuxChangePolicy, otherwise some pods can get stuck in ContainerCreating state. + Note that this field cannot be set when spec.os.name is windows. + """ + seLinuxOptions: Optional[SeLinuxOptions] = None + """ + 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. + """ + seccompProfile: Optional[SeccompProfile] = None + """ + The seccomp options to use by the containers in this pod. + Note that this field cannot be set when spec.os.name is windows. + """ + supplementalGroups: Optional[List[int]] = None + """ + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. + If unspecified, no additional groups are added, though group memberships + defined in the container image may still be used, depending on the + supplementalGroupsPolicy field. + Note that this field cannot be set when spec.os.name is windows. + """ + supplementalGroupsPolicy: Optional[str] = None + """ + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + """ + sysctls: Optional[List[Sysctl]] = None + """ + 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. + """ + windowsOptions: Optional[WindowsOptions] = None + """ + 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 Toleration(BaseModel): + effect: Optional[str] = None + """ + Effect indicates the taint effect to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + """ + key: Optional[str] = None + """ + 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[str] = None + """ + Operator represents a key's relationship to the value. + Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a pod can + tolerate all taints of a particular category. + Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators). + """ + tolerationSeconds: Optional[int] = None + """ + 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] = None + """ + Value is the taint value the toleration matches to. + If the operator is Exists, the value should be empty, otherwise just a regular string. + """ + + +class TopologySpreadConstraint(BaseModel): + labelSelector: Optional[LabelSelector] = None + """ + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. + """ + matchLabelKeys: Optional[List[str]] = None + """ + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. + MatchLabelKeys cannot be set when LabelSelector isn't set. + Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. + + This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default). + """ + maxSkew: int + """ + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. + """ + minDomains: Optional[int] = None + """ + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + """ + nodeAffinityPolicy: Optional[str] = None + """ + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + """ + nodeTaintsPolicy: Optional[str] = None + """ + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. + - Ignore: node taints are ignored. All nodes are included. + + If this value is nil, the behavior is equivalent to the Ignore policy. + """ + topologyKey: str + """ + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. + """ + whenUnsatisfiable: str + """ + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. + """ + + +class AwsElasticBlockStore(BaseModel): + fsType: Optional[str] = None + """ + fsType is the 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] = None + """ + partition is 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). + """ + readOnly: Optional[bool] = None + """ + readOnly value true will force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + """ + volumeID: str + """ + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + """ + + +class AzureDisk(BaseModel): + cachingMode: Optional[str] = None + """ + cachingMode is the Host Caching mode: None, Read Only, Read Write. + """ + diskName: str + """ + diskName is the Name of the data disk in the blob storage + """ + diskURI: str + """ + diskURI is the URI of data disk in the blob storage + """ + fsType: Optional[str] = 'ext4' + """ + fsType is 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] = None + """ + kind expected values are 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 + """ + readOnly: Optional[bool] = False + """ + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + """ + + +class AzureFile(BaseModel): + readOnly: Optional[bool] = None + """ + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + """ + secretName: str + """ + secretName is the name of secret that contains Azure Storage Account Name and Key + """ + shareName: str + """ + shareName is the azure share Name + """ + + +class SecretRefModel(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class Cephfs(BaseModel): + monitors: List[str] + """ + monitors is 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] = None + """ + path is Optional: Used as the mounted root, rather than the full Ceph tree, default is / + """ + readOnly: Optional[bool] = None + """ + readOnly is 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 + """ + secretFile: Optional[str] = None + """ + secretFile is 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 + """ + secretRef: Optional[SecretRefModel] = None + """ + secretRef is 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] = None + """ + user is optional: User is the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + """ + + +class Cinder(BaseModel): + fsType: Optional[str] = None + """ + fsType is the 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 + """ + readOnly: Optional[bool] = None + """ + readOnly 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 + """ + secretRef: Optional[SecretRefModel] = None + """ + secretRef is optional: points to a secret object containing parameters used to connect + to OpenStack. + """ + volumeID: str + """ + volumeID used to identify the volume in cinder. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + """ + + +class Item(BaseModel): + key: str + """ + key is the key to project. + """ + mode: Optional[int] = None + """ + mode is 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 + """ + path is 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 ConfigMap(BaseModel): + defaultMode: Optional[int] = None + """ + defaultMode is 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[Item]] = None + """ + items 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] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + optional: Optional[bool] = None + """ + optional specify whether the ConfigMap or its keys must be defined + """ + + +class NodePublishSecretRef(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class Csi(BaseModel): + driver: str + """ + 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. + """ + fsType: Optional[str] = None + """ + fsType 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. + """ + nodePublishSecretRef: Optional[NodePublishSecretRef] = None + """ + 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. + """ + readOnly: Optional[bool] = None + """ + readOnly specifies a read-only configuration for the volume. + Defaults to false (read/write). + """ + volumeAttributes: Optional[Dict[str, str]] = None + """ + volumeAttributes stores driver-specific properties that are passed to the CSI + driver. Consult your driver's documentation for supported values. + """ + + +class DivisorModel5(RootModel[int]): + root: int + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class DivisorModel6( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class ItemModel(BaseModel): + fieldRef: Optional[FieldRef] = None + """ + Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported. + """ + mode: Optional[int] = None + """ + 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 + """ + 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 '..' + """ + resourceFieldRef: Optional[ResourceFieldRef] = None + """ + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. + """ + + +class DownwardAPI(BaseModel): + defaultMode: Optional[int] = None + """ + 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[ItemModel]] = None + """ + Items is a list of downward API volume file + """ + + +class SizeLimit(RootModel[int]): + root: int + """ + sizeLimit is the 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: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + """ + + +class SizeLimitModel( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + """ + sizeLimit is the 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: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + """ + + +class EmptyDir(BaseModel): + medium: Optional[str] = None + """ + medium represents 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 + """ + sizeLimit: Optional[Union[SizeLimit, SizeLimitModel]] = None + """ + sizeLimit is the 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: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + """ + + +class DataSource(BaseModel): + apiGroup: Optional[str] = None + """ + 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 + """ + Kind is the type of resource being referenced + """ + name: str + """ + Name is the name of resource being referenced + """ + + +class DataSourceRef(BaseModel): + apiGroup: Optional[str] = None + """ + 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 + """ + Kind is the type of resource being referenced + """ + name: str + """ + Name is the name of resource being referenced + """ + namespace: Optional[str] = None + """ + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + """ + + +class LimitsModel7(RootModel[int]): + root: int + + +class LimitsModel8( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class RequestsModel7(RootModel[int]): + root: int + + +class RequestsModel8( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + + +class ResourcesModel(BaseModel): + limits: Optional[Dict[str, Union[LimitsModel7, LimitsModel8]]] = None + """ + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + """ + requests: Optional[Dict[str, Union[RequestsModel7, RequestsModel8]]] = None + """ + 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. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + """ + + +class Spec(BaseModel): + accessModes: Optional[List[str]] = None + """ + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + """ + dataSource: Optional[DataSource] = None + """ + dataSource 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. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. + """ + dataSourceRef: Optional[DataSourceRef] = None + """ + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any 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, when namespace isn't specified in dataSourceRef, + 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. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + """ + resources: Optional[ResourcesModel] = None + """ + resources represents the minimum resources the volume should have. + 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[Selector] = None + """ + selector is a label query over volumes to consider for binding. + """ + storageClassName: Optional[str] = None + """ + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + """ + volumeAttributesClassName: Optional[str] = None + """ + volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. + If specified, the CSI driver will create or update the volume with the attributes defined + in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, + it can be changed after the claim is created. An empty string or nil value indicates that no + VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, + this field can be reset to its previous value (including nil) to cancel the modification. + If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be + set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource + exists. + More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ + """ + volumeMode: Optional[str] = None + """ + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. + """ + volumeName: Optional[str] = None + """ + volumeName is the binding reference to the PersistentVolume backing this claim. + """ + + +class VolumeClaimTemplate(BaseModel): + metadata: Optional[MetadataModel] = None + """ + 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: Spec + """ + 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 Ephemeral(BaseModel): + volumeClaimTemplate: Optional[VolumeClaimTemplate] = None + """ + 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). + + An 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. + + This field is read-only and no changes will be made by Kubernetes + to the PVC after it has been created. + + Required, must not be nil. + """ + + +class Fc(BaseModel): + fsType: Optional[str] = None + """ + fsType is the 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] = None + """ + lun is Optional: FC target lun number + """ + readOnly: Optional[bool] = None + """ + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + """ + targetWWNs: Optional[List[str]] = None + """ + targetWWNs is Optional: FC target worldwide names (WWNs) + """ + wwids: Optional[List[str]] = None + """ + wwids Optional: FC volume world wide identifiers (wwids) + Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. + """ + + +class FlexVolume(BaseModel): + driver: str + """ + driver is the name of the driver to use for this volume. + """ + fsType: Optional[str] = None + """ + fsType is the 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]] = None + """ + options is Optional: this field holds extra command options if any. + """ + readOnly: Optional[bool] = None + """ + readOnly is Optional: defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + """ + secretRef: Optional[SecretRefModel] = None + """ + secretRef is 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 Flocker(BaseModel): + datasetName: Optional[str] = None + """ + datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker + should be considered as deprecated + """ + datasetUUID: Optional[str] = None + """ + datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset + """ + + +class GcePersistentDisk(BaseModel): + fsType: Optional[str] = None + """ + fsType is 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] = None + """ + partition is 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 + """ + pdName: str + """ + pdName is 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 + """ + readOnly: Optional[bool] = None + """ + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + """ + + +class GitRepo(BaseModel): + directory: Optional[str] = None + """ + directory is the 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 + """ + repository is the URL + """ + revision: Optional[str] = None + """ + revision is the commit hash for the specified revision. + """ + + +class Glusterfs(BaseModel): + endpoints: str + """ + endpoints is the endpoint name that details Glusterfs topology. + """ + path: str + """ + path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + """ + readOnly: Optional[bool] = None + """ + 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 + """ + + +class HostPath(BaseModel): + path: str + """ + 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] = None + """ + type for HostPath Volume + Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + """ + + +class Image(BaseModel): + pullPolicy: Optional[str] = None + """ + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + """ + reference: Optional[str] = None + """ + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + 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. + """ + + +class Iscsi(BaseModel): + chapAuthDiscovery: Optional[bool] = None + """ + chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication + """ + chapAuthSession: Optional[bool] = None + """ + chapAuthSession defines whether support iSCSI Session CHAP authentication + """ + fsType: Optional[str] = None + """ + fsType is the 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 + """ + initiatorName: Optional[str] = None + """ + initiatorName is the custom iSCSI Initiator Name. + If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface + : will be created for the connection. + """ + iqn: str + """ + iqn is the target iSCSI Qualified Name. + """ + iscsiInterface: Optional[str] = 'default' + """ + iscsiInterface is the interface Name that uses an iSCSI transport. + Defaults to 'default' (tcp). + """ + lun: int + """ + lun represents iSCSI Target Lun number. + """ + portals: Optional[List[str]] = None + """ + portals is the 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). + """ + readOnly: Optional[bool] = None + """ + readOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + """ + secretRef: Optional[SecretRefModel] = None + """ + secretRef is the CHAP Secret for iSCSI target and initiator authentication + """ + targetPortal: str + """ + targetPortal is 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 Nfs(BaseModel): + path: str + """ + path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + """ + readOnly: Optional[bool] = None + """ + 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 + """ + server is the hostname or IP address of the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + """ + + +class PersistentVolumeClaim(BaseModel): + claimName: str + """ + 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 + """ + readOnly: Optional[bool] = None + """ + readOnly Will force the ReadOnly setting in VolumeMounts. + Default false. + """ + + +class PhotonPersistentDisk(BaseModel): + fsType: Optional[str] = None + """ + fsType is the 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. + """ + pdID: str + """ + pdID is the ID that identifies Photon Controller persistent disk + """ + + +class PortworxVolume(BaseModel): + fsType: Optional[str] = None + """ + 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. + """ + readOnly: Optional[bool] = None + """ + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + """ + volumeID: str + """ + volumeID uniquely identifies a Portworx volume + """ + + +class ClusterTrustBundle(BaseModel): + labelSelector: Optional[LabelSelector] = None + """ + Select all ClusterTrustBundles that match this label selector. Only has + effect if signerName is set. Mutually-exclusive with name. If unset, + interpreted as "match nothing". If set but empty, interpreted as "match + everything". + """ + name: Optional[str] = None + """ + Select a single ClusterTrustBundle by object name. Mutually-exclusive + with signerName and labelSelector. + """ + optional: Optional[bool] = None + """ + If true, don't block pod startup if the referenced ClusterTrustBundle(s) + aren't available. If using name, then the named ClusterTrustBundle is + allowed not to exist. If using signerName, then the combination of + signerName and labelSelector is allowed to match zero + ClusterTrustBundles. + """ + path: str + """ + Relative path from the volume root to write the bundle. + """ + signerName: Optional[str] = None + """ + Select all ClusterTrustBundles that match this signer name. + Mutually-exclusive with name. The contents of all selected + ClusterTrustBundles will be unified and deduplicated. + """ + + +class ItemModel1(BaseModel): + key: str + """ + key is the key to project. + """ + mode: Optional[int] = None + """ + mode is 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 + """ + path is 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 ConfigMapModel(BaseModel): + items: Optional[List[ItemModel1]] = None + """ + items 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] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + optional: Optional[bool] = None + """ + optional specify whether the ConfigMap or its keys must be defined + """ + + +class DivisorModel7(RootModel[int]): + root: int + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class DivisorModel8( + RootModel[ + constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + ] +): + root: constr( + pattern=r'^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$' + ) + """ + Specifies the output format of the exposed resources, defaults to "1" + """ + + +class ItemModel2(BaseModel): + fieldRef: Optional[FieldRef] = None + """ + Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported. + """ + mode: Optional[int] = None + """ + 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 + """ + 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 '..' + """ + resourceFieldRef: Optional[ResourceFieldRef] = None + """ + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. + """ + + +class DownwardAPIModel(BaseModel): + items: Optional[List[ItemModel2]] = None + """ + Items is a list of DownwardAPIVolume file + """ + + +class PodCertificate(BaseModel): + certificateChainPath: Optional[str] = None + """ + Write the certificate chain at this path in the projected volume. + + Most applications should use credentialBundlePath. When using keyPath + and certificateChainPath, your application needs to check that the key + and leaf certificate are consistent, because it is possible to read the + files mid-rotation. + """ + credentialBundlePath: Optional[str] = None + """ + Write the credential bundle at this path in the projected volume. + + The credential bundle is a single file that contains multiple PEM blocks. + The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private + key. + + The remaining blocks are CERTIFICATE blocks, containing the issued + certificate chain from the signer (leaf and any intermediates). + + Using credentialBundlePath lets your Pod's application code make a single + atomic read that retrieves a consistent key and certificate chain. If you + project them to separate files, your application code will need to + additionally check that the leaf certificate was issued to the key. + """ + keyPath: Optional[str] = None + """ + Write the key at this path in the projected volume. + + Most applications should use credentialBundlePath. When using keyPath + and certificateChainPath, your application needs to check that the key + and leaf certificate are consistent, because it is possible to read the + files mid-rotation. + """ + keyType: str + """ + The type of keypair Kubelet will generate for the pod. + + Valid values are "RSA3072", "RSA4096", "ECDSAP256", "ECDSAP384", + "ECDSAP521", and "ED25519". + """ + maxExpirationSeconds: Optional[int] = None + """ + maxExpirationSeconds is the maximum lifetime permitted for the + certificate. + + Kubelet copies this value verbatim into the PodCertificateRequests it + generates for this projection. + + If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver + will reject values shorter than 3600 (1 hour). The maximum allowable + value is 7862400 (91 days). + + The signer implementation is then free to issue a certificate with any + lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 + seconds (1 hour). This constraint is enforced by kube-apiserver. + `kubernetes.io` signers will never issue certificates with a lifetime + longer than 24 hours. + """ + signerName: str + """ + Kubelet's generated CSRs will be addressed to this signer. + """ + userAnnotations: Optional[Dict[str, str]] = None + """ + userAnnotations allow pod authors to pass additional information to + the signer implementation. Kubernetes does not restrict or validate this + metadata in any way. + + These values are copied verbatim into the `spec.unverifiedUserAnnotations` field of + the PodCertificateRequest objects that Kubelet creates. + + Entries are subject to the same validation as object metadata annotations, + with the addition that all keys must be domain-prefixed. No restrictions + are placed on values, except an overall size limitation on the entire field. + + Signers should document the keys and values they support. Signers should + deny requests that contain keys they do not recognize. + """ + + +class ItemModel3(BaseModel): + key: str + """ + key is the key to project. + """ + mode: Optional[int] = None + """ + mode is 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 + """ + path is 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 Secret(BaseModel): + items: Optional[List[ItemModel3]] = None + """ + items 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] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + optional: Optional[bool] = None + """ + optional field specify whether the Secret or its key must be defined + """ + + +class ServiceAccountToken(BaseModel): + audience: Optional[str] = None + """ + 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. + """ + expirationSeconds: Optional[int] = None + """ + 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 + """ + path is the path relative to the mount point of the file to project the + token into. + """ + + +class Source(BaseModel): + clusterTrustBundle: Optional[ClusterTrustBundle] = None + """ + ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field + of ClusterTrustBundle objects in an auto-updating file. + + Alpha, gated by the ClusterTrustBundleProjection feature gate. + + ClusterTrustBundle objects can either be selected by name, or by the + combination of signer name and a label selector. + + Kubelet performs aggressive normalization of the PEM contents written + into the pod filesystem. Esoteric PEM features such as inter-block + comments and block headers are stripped. Certificates are deduplicated. + The ordering of certificates within the file is arbitrary, and Kubelet + may change the order over time. + """ + configMap: Optional[ConfigMapModel] = None + """ + configMap information about the configMap data to project + """ + downwardAPI: Optional[DownwardAPIModel] = None + """ + downwardAPI information about the downwardAPI data to project + """ + podCertificate: Optional[PodCertificate] = None + """ + Projects an auto-rotating credential bundle (private key and certificate + chain) that the pod can use either as a TLS client or server. + + Kubelet generates a private key and uses it to send a + PodCertificateRequest to the named signer. Once the signer approves the + request and issues a certificate chain, Kubelet writes the key and + certificate chain to the pod filesystem. The pod does not start until + certificates have been issued for each podCertificate projected volume + source in its spec. + + Kubelet will begin trying to rotate the certificate at the time indicated + by the signer using the PodCertificateRequest.Status.BeginRefreshAt + timestamp. + + Kubelet can write a single file, indicated by the credentialBundlePath + field, or separate files, indicated by the keyPath and + certificateChainPath fields. + + The credential bundle is a single file in PEM format. The first PEM + entry is the private key (in PKCS#8 format), and the remaining PEM + entries are the certificate chain issued by the signer (typically, + signers will return their certificate chain in leaf-to-root order). + + Prefer using the credential bundle format, since your application code + can read it atomically. If you use keyPath and certificateChainPath, + your application must make two separate file reads. If these coincide + with a certificate rotation, it is possible that the private key and leaf + certificate you read may not correspond to each other. Your application + will need to check for this condition, and re-read until they are + consistent. + + The named signer controls chooses the format of the certificate it + issues; consult the signer implementation's documentation to learn how to + use the certificates it issues. + """ + secret: Optional[Secret] = None + """ + secret information about the secret data to project + """ + serviceAccountToken: Optional[ServiceAccountToken] = None + """ + serviceAccountToken is information about the serviceAccountToken data to project + """ + + +class Projected(BaseModel): + defaultMode: Optional[int] = None + """ + defaultMode are the 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[Source]] = None + """ + sources is the list of volume projections. Each entry in this list + handles one source. + """ + + +class Quobyte(BaseModel): + group: Optional[str] = None + """ + group to map volume access to + Default is no group + """ + readOnly: Optional[bool] = None + """ + readOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. + """ + registry: str + """ + 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] = None + """ + tenant owning the given Quobyte volume in the Backend + Used with dynamically provisioned Quobyte volumes, value is set by the plugin + """ + user: Optional[str] = None + """ + user to map volume access to + Defaults to serivceaccount user + """ + volume: str + """ + volume is a string that references an already created Quobyte volume by name. + """ + + +class Rbd(BaseModel): + fsType: Optional[str] = None + """ + fsType is the 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 + """ + image is the rados image name. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + """ + keyring: Optional[str] = '/etc/ceph/keyring' + """ + 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] + """ + monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + """ + pool: Optional[str] = 'rbd' + """ + pool is the rados pool name. + Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + """ + readOnly: Optional[bool] = None + """ + 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 + """ + secretRef: Optional[SecretRefModel] = None + """ + 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] = 'admin' + """ + user is the rados user name. + Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + """ + + +class ScaleIO(BaseModel): + fsType: Optional[str] = 'xfs' + """ + fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". + Default is "xfs". + """ + gateway: str + """ + gateway is the host address of the ScaleIO API Gateway. + """ + protectionDomain: Optional[str] = None + """ + protectionDomain is the name of the ScaleIO Protection Domain for the configured storage. + """ + readOnly: Optional[bool] = None + """ + readOnly Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + """ + secretRef: SecretRefModel + """ + secretRef references to the secret for ScaleIO user and other + sensitive information. If this is not provided, Login operation will fail. + """ + sslEnabled: Optional[bool] = None + """ + sslEnabled Flag enable/disable SSL communication with Gateway, default false + """ + storageMode: Optional[str] = 'ThinProvisioned' + """ + storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. + Default is ThinProvisioned. + """ + storagePool: Optional[str] = None + """ + storagePool is the ScaleIO Storage Pool associated with the protection domain. + """ + system: str + """ + system is the name of the storage system as configured in ScaleIO. + """ + volumeName: Optional[str] = None + """ + volumeName is the name of a volume already created in the ScaleIO system + that is associated with this volume source. + """ + + +class SecretModel(BaseModel): + defaultMode: Optional[int] = None + """ + defaultMode is 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[ItemModel3]] = None + """ + items 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] = None + """ + optional field specify whether the Secret or its keys must be defined + """ + secretName: Optional[str] = None + """ + secretName is the name of the secret in the pod's namespace to use. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + """ + + +class Storageos(BaseModel): + fsType: Optional[str] = None + """ + fsType is the 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. + """ + readOnly: Optional[bool] = None + """ + readOnly defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + """ + secretRef: Optional[SecretRefModel] = None + """ + secretRef specifies the secret to use for obtaining the StorageOS API + credentials. If not specified, default values will be attempted. + """ + volumeName: Optional[str] = None + """ + volumeName is the human-readable name of the StorageOS volume. Volume + names are only unique within a namespace. + """ + volumeNamespace: Optional[str] = None + """ + 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. + """ + + +class VsphereVolume(BaseModel): + fsType: Optional[str] = None + """ + fsType is 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. + """ + storagePolicyID: Optional[str] = None + """ + storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. + """ + storagePolicyName: Optional[str] = None + """ + storagePolicyName is the storage Policy Based Management (SPBM) profile name. + """ + volumePath: str + """ + volumePath is the path that identifies vSphere volume vmdk + """ + + +class Volume(BaseModel): + awsElasticBlockStore: Optional[AwsElasticBlockStore] = None + """ + awsElasticBlockStore represents an AWS Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + Deprecated: AWSElasticBlockStore is deprecated. All operations for the in-tree + awsElasticBlockStore type are redirected to the ebs.csi.aws.com CSI driver. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + """ + azureDisk: Optional[AzureDisk] = None + """ + azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type + are redirected to the disk.csi.azure.com CSI driver. + """ + azureFile: Optional[AzureFile] = None + """ + azureFile represents an Azure File Service mount on the host and bind mount to the pod. + Deprecated: AzureFile is deprecated. All operations for the in-tree azureFile type + are redirected to the file.csi.azure.com CSI driver. + """ + cephfs: Optional[Cephfs] = None + """ + cephFS represents a Ceph FS mount on the host that shares a pod's lifetime. + Deprecated: CephFS is deprecated and the in-tree cephfs type is no longer supported. + """ + cinder: Optional[Cinder] = None + """ + cinder represents a cinder volume attached and mounted on kubelets host machine. + Deprecated: Cinder is deprecated. All operations for the in-tree cinder type + are redirected to the cinder.csi.openstack.org CSI driver. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md + """ + configMap: Optional[ConfigMap] = None + """ + configMap represents a configMap that should populate this volume + """ + csi: Optional[Csi] = None + """ + csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers. + """ + downwardAPI: Optional[DownwardAPI] = None + """ + downwardAPI represents downward API about the pod that should populate this volume + """ + emptyDir: Optional[EmptyDir] = None + """ + emptyDir represents a temporary directory that shares a pod's lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir + """ + ephemeral: Optional[Ephemeral] = None + """ + 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. + + Use this if: + a) the volume is only needed while the pod runs, + b) features of normal volumes like restoring from snapshot or capacity + tracking are needed, + c) the storage driver is specified through a storage class, and + d) the storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for more + information on the connection between this volume type + and PersistentVolumeClaim). + + Use PersistentVolumeClaim or one of the vendor-specific + APIs for volumes that persist for longer than the lifecycle + of an individual pod. + + Use 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. + + A pod can use both types of ephemeral volumes and + persistent volumes at the same time. + """ + fc: Optional[Fc] = None + """ + fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. + """ + flexVolume: Optional[FlexVolume] = None + """ + flexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. + Deprecated: FlexVolume is deprecated. Consider using a CSIDriver instead. + """ + flocker: Optional[Flocker] = None + """ + flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running. + Deprecated: Flocker is deprecated and the in-tree flocker type is no longer supported. + """ + gcePersistentDisk: Optional[GcePersistentDisk] = None + """ + gcePersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + Deprecated: GCEPersistentDisk is deprecated. All operations for the in-tree + gcePersistentDisk type are redirected to the pd.csi.storage.gke.io CSI driver. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + """ + gitRepo: Optional[GitRepo] = None + """ + 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[Glusterfs] = None + """ + glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. + Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported. + """ + hostPath: Optional[HostPath] = None + """ + 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 + """ + image: Optional[Image] = None + """ + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + + The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. + A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. + The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. + The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. + The volume will be mounted read-only (ro) and non-executable files (noexec). + Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. + The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. + """ + iscsi: Optional[Iscsi] = None + """ + iscsi represents an ISCSI 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/#iscsi + """ + name: str + """ + name of the volume. + 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[Nfs] = None + """ + nfs represents an NFS mount on the host that shares a pod's lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + """ + persistentVolumeClaim: Optional[PersistentVolumeClaim] = None + """ + persistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + """ + photonPersistentDisk: Optional[PhotonPersistentDisk] = None + """ + photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. + Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported. + """ + portworxVolume: Optional[PortworxVolume] = None + """ + portworxVolume represents a portworx volume attached and mounted on kubelets host machine. + Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type + are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate + is on. + """ + projected: Optional[Projected] = None + """ + projected items for all in one resources secrets, configmaps, and downward API + """ + quobyte: Optional[Quobyte] = None + """ + quobyte represents a Quobyte mount on the host that shares a pod's lifetime. + Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported. + """ + rbd: Optional[Rbd] = None + """ + rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. + Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. + """ + scaleIO: Optional[ScaleIO] = None + """ + scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. + Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported. + """ + secret: Optional[SecretModel] = None + """ + secret represents a secret that should populate this volume. + More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + """ + storageos: Optional[Storageos] = None + """ + storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. + Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported. + """ + vsphereVolume: Optional[VsphereVolume] = None + """ + vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine. + Deprecated: VsphereVolume is deprecated. All operations for the in-tree vsphereVolume type + are redirected to the csi.vsphere.vmware.com CSI driver. + """ + + +class WorkloadRef(BaseModel): + name: str + """ + Name defines the name of the Workload object this Pod belongs to. + Workload must be in the same namespace as the Pod. + If it doesn't match any existing Workload, the Pod will remain unschedulable + until a Workload object is created and observed by the kube-scheduler. + It must be a DNS subdomain. + """ + podGroup: str + """ + PodGroup is the name of the PodGroup within the Workload that this Pod + belongs to. If it doesn't match any existing PodGroup within the Workload, + the Pod will remain unschedulable until the Workload object is recreated + and observed by the kube-scheduler. It must be a DNS label. + """ + podGroupReplicaKey: Optional[str] = None + """ + PodGroupReplicaKey specifies the replica key of the PodGroup to which this + Pod belongs. It is used to distinguish pods belonging to different replicas + of the same pod group. The pod group policy is applied separately to each replica. + When set, it must be a DNS label. + """ + + +class SpecModel(BaseModel): + activeDeadlineSeconds: Optional[int] = None + """ + Optional duration in seconds the pod may be active on the node relative to + StartTime before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + """ + affinity: Optional[Affinity] = None + """ + If specified, the pod's scheduling constraints + """ + automountServiceAccountToken: Optional[bool] = None + """ + AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. + """ + containers: List[Container] + """ + List of containers belonging to the pod. + Containers cannot currently be added or removed. + There must be at least one container in a Pod. + Cannot be updated. + """ + dnsConfig: Optional[DnsConfig] = None + """ + Specifies the DNS parameters of a pod. + Parameters specified here will be merged to the generated DNS + configuration based on DNSPolicy. + """ + dnsPolicy: Optional[str] = None + """ + 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'. + """ + enableServiceLinks: Optional[bool] = None + """ + EnableServiceLinks indicates whether information about services should be injected into pod's + environment variables, matching the syntax of Docker links. + Optional: Defaults to true. + """ + ephemeralContainers: Optional[List[EphemeralContainer]] = None + """ + List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing + pod to perform user-initiated actions such as debugging. This list cannot be specified when + creating a pod, and it cannot be modified by updating the pod spec. In order to add an + ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. + """ + hostAliases: Optional[List[HostAliase]] = None + """ + HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts + file if specified. + """ + hostIPC: Optional[bool] = None + """ + Use the host's ipc namespace. + Optional: Default to false. + """ + hostNetwork: Optional[bool] = None + """ + Host networking requested for this pod. Use the host's network namespace. + When using HostNetwork you should specify ports so the scheduler is aware. + When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`, + and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`. + Default to false. + """ + hostPID: Optional[bool] = None + """ + Use the host's pid namespace. + Optional: Default to false. + """ + hostUsers: Optional[bool] = None + """ + Use the host's user namespace. + Optional: Default to true. + If set to true or not present, the pod will be run in the host user namespace, useful + for when the pod needs a feature only available to the host user namespace, such as + loading a kernel module with CAP_SYS_MODULE. + When set to false, a new userns is created for the pod. Setting false is useful for + mitigating container breakout vulnerabilities even allowing users to run their + containers as root without actually having root privileges on the host. + This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature. + """ + hostname: Optional[str] = None + """ + Specifies the hostname of the Pod + If not specified, the pod's hostname will be set to a system-defined value. + """ + hostnameOverride: Optional[str] = None + """ + HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. + This field only specifies the pod's hostname and does not affect its DNS records. + When this field is set to a non-empty string: + - It takes precedence over the values set in `hostname` and `subdomain`. + - The Pod's hostname will be set to this value. + - `setHostnameAsFQDN` must be nil or set to false. + - `hostNetwork` must be set to false. + + This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. + Requires the HostnameOverride feature gate to be enabled. + """ + imagePullSecrets: Optional[List[ImagePullSecret]] = None + """ + 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. + If specified, these secrets will be passed to individual puller implementations for them to use. + More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod + """ + initContainers: Optional[List[InitContainer]] = None + """ + List of initialization containers belonging to the pod. + Init containers are executed in order prior to containers being started. If any + init container fails, the pod is considered to have failed and is handled according + to its restartPolicy. The name for an init container or normal container must be + unique among all containers. + Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. + The resourceRequirements of an init container are taken into account during scheduling + by finding the highest request/limit for each resource type, and then using the max of + that value or the sum of the normal containers. Limits are applied to init containers + in a similar fashion. + Init containers cannot currently be added or removed. + Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ + """ + nodeName: Optional[str] = None + """ + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename + """ + nodeSelector: Optional[Dict[str, str]] = None + """ + NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that node. + More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + """ + os: Optional[Os] = None + """ + Specifies the OS of the containers in the pod. + Some pod and container fields are restricted if this is set. + + If the OS field is set to linux, the following fields must be unset: + -securityContext.windowsOptions + + If the OS field is set to windows, following fields must be unset: + - spec.hostPID + - spec.hostIPC + - spec.hostUsers + - spec.resources + - spec.securityContext.appArmorProfile + - spec.securityContext.seLinuxOptions + - spec.securityContext.seccompProfile + - spec.securityContext.fsGroup + - spec.securityContext.fsGroupChangePolicy + - spec.securityContext.sysctls + - spec.shareProcessNamespace + - spec.securityContext.runAsUser + - spec.securityContext.runAsGroup + - spec.securityContext.supplementalGroups + - spec.securityContext.supplementalGroupsPolicy + - spec.containers[*].securityContext.appArmorProfile + - spec.containers[*].securityContext.seLinuxOptions + - spec.containers[*].securityContext.seccompProfile + - spec.containers[*].securityContext.capabilities + - spec.containers[*].securityContext.readOnlyRootFilesystem + - spec.containers[*].securityContext.privileged + - spec.containers[*].securityContext.allowPrivilegeEscalation + - spec.containers[*].securityContext.procMount + - spec.containers[*].securityContext.runAsUser + - spec.containers[*].securityContext.runAsGroup + """ + overhead: Optional[Dict[str, Union[Overhead, OverheadModel]]] = None + """ + Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. + This field will be autopopulated at admission time by the RuntimeClass admission controller. If + the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. + The RuntimeClass admission controller will reject Pod create requests which have the overhead already + set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value + defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. + More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + """ + preemptionPolicy: Optional[str] = None + """ + PreemptionPolicy is the Policy for preempting pods with lower priority. + One of Never, PreemptLowerPriority. + Defaults to PreemptLowerPriority if unset. + """ + priority: Optional[int] = None + """ + The priority value. Various system components use this field to find the + priority of the pod. When Priority Admission Controller is enabled, it + prevents users from setting this field. The admission controller populates + this field from PriorityClassName. + The higher the value, the higher the priority. + """ + priorityClassName: Optional[str] = None + """ + If specified, indicates the pod's priority. "system-node-critical" and + "system-cluster-critical" are two special keywords which indicate the + highest priorities with the former being the highest priority. Any other + name must be defined by creating a PriorityClass object with that name. + If not specified, the pod priority will be default or zero if there is no + default. + """ + readinessGates: Optional[List[ReadinessGate]] = None + """ + If specified, all readiness gates will be evaluated for pod readiness. + A pod is ready when all its containers are ready AND + all conditions specified in the readiness gates have status equal to "True" + More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates + """ + resourceClaims: Optional[List[ResourceClaim]] = None + """ + ResourceClaims defines which ResourceClaims must be allocated + and reserved before the Pod is allowed to start. The resources + will be made available to those containers which consume them + by name. + + This is a stable field but requires that the + DynamicResourceAllocation feature gate is enabled. + + This field is immutable. + """ + resources: Optional[Resources] = None + """ + Resources is the total amount of CPU and Memory resources required by all + containers in the pod. It supports specifying Requests and Limits for + "cpu", "memory" and "hugepages-" resource names only. ResourceClaims are not supported. + + This field enables fine-grained control over resource allocation for the + entire pod, allowing resource sharing among containers in a pod. + + This is an alpha field and requires enabling the PodLevelResources feature + gate. + """ + restartPolicy: Optional[str] = None + """ + Restart policy for all containers within the pod. + One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted. + Default to Always. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy + """ + runtimeClassName: Optional[str] = None + """ + RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used + to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. + If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an + empty definition that uses the default runtime handler. + More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class + """ + schedulerName: Optional[str] = None + """ + If specified, the pod will be dispatched by specified scheduler. + If not specified, the pod will be dispatched by default scheduler. + """ + schedulingGates: Optional[List[SchedulingGate]] = None + """ + SchedulingGates is an opaque list of values that if specified will block scheduling the pod. + If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the + scheduler will not attempt to schedule the pod. + + SchedulingGates can only be set at pod creation time, and be removed only afterwards. + """ + securityContext: Optional[SecurityContextModel] = None + """ + SecurityContext holds pod-level security attributes and common container settings. + Optional: Defaults to empty. See type description for default values of each field. + """ + serviceAccount: Optional[str] = None + """ + DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead. + """ + serviceAccountName: Optional[str] = None + """ + ServiceAccountName is the name of the ServiceAccount to use to run this pod. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ + """ + setHostnameAsFQDN: Optional[bool] = None + """ + If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). + In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). + In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. + If a pod does not have FQDN, this has no effect. + Default to false. + """ + shareProcessNamespace: Optional[bool] = None + """ + Share a single process namespace between all of the containers in a pod. + When this is set containers will be able to view and signal processes from other containers + in the same pod, and the first process in each container will not be assigned PID 1. + HostPID and ShareProcessNamespace cannot both be set. + Optional: Default to false. + """ + subdomain: Optional[str] = None + """ + If specified, the fully qualified Pod hostname will be "...svc.". + If not specified, the pod will not have a domainname at all. + """ + terminationGracePeriodSeconds: Optional[int] = None + """ + Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. + Value must be non-negative integer. The value zero indicates stop immediately via + the kill signal (no opportunity to shut down). + If this value is nil, the default grace period will be used instead. + 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. + Defaults to 30 seconds. + """ + tolerations: Optional[List[Toleration]] = None + """ + If specified, the pod's tolerations. + """ + topologySpreadConstraints: Optional[List[TopologySpreadConstraint]] = None + """ + TopologySpreadConstraints describes how a group of pods ought to spread across topology + domains. Scheduler will schedule pods in a way which abides by the constraints. + All topologySpreadConstraints are ANDed. + """ + volumes: Optional[List[Volume]] = None + """ + List of volumes that can be mounted by containers belonging to the pod. + More info: https://kubernetes.io/docs/concepts/storage/volumes + """ + workloadRef: Optional[WorkloadRef] = None + """ + WorkloadRef provides a reference to the Workload object that this Pod belongs to. + This field is used by the scheduler to identify the PodGroup and apply the + correct group scheduling policies. The Workload object referenced + by this field may not exist at the time the Pod is created. + This field is immutable, but a Workload object with the same name + may be recreated with different policies. Doing this during pod scheduling + may result in the placement not conforming to the expected policies. + """ + + +class Template(BaseModel): + metadata: Optional[MetadataModel] = None + """ + Standard object's metadata. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[SpecModel] = None + """ + Specification of the desired behavior of the pod. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + """ + + +class SpecModel1(BaseModel): + minReadySeconds: Optional[int] = None + """ + Minimum number of seconds for which a newly created pod should be ready + without any of its container crashing, for it to be considered available. + Defaults to 0 (pod will be considered available as soon as it is ready) + """ + paused: Optional[bool] = None + """ + Indicates that the deployment is paused. + """ + progressDeadlineSeconds: Optional[int] = None + """ + The maximum time in seconds for a deployment to make progress before it + is considered to be failed. The deployment controller will continue to + process failed deployments and a condition with a ProgressDeadlineExceeded + reason will be surfaced in the deployment status. Note that progress will + not be estimated during the time a deployment is paused. Defaults to 600s. + """ + replicas: Optional[int] = None + """ + Number of desired pods. This is a pointer to distinguish between explicit + zero and not specified. Defaults to 1. + """ + revisionHistoryLimit: Optional[int] = None + """ + The number of old ReplicaSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 10. + """ + selector: Selector + """ + Label selector for pods. Existing ReplicaSets whose pods are + selected by this will be the ones affected by this deployment. + It must match the pod template's labels. + """ + strategy: Optional[Strategy] = None + """ + The deployment strategy to use to replace existing pods with new ones. + """ + template: Template + """ + Template describes the pods that will be created. + The only allowed template.spec.restartPolicy value is "Always". + """ + + +class DeploymentTemplate(BaseModel): + metadata: Optional[Metadata] = None + """ + Metadata contains the configurable metadata fields for the Deployment. + """ + spec: Optional[SpecModel1] = None + """ + Spec contains the configurable spec fields for the Deployment object. + """ + + +class MetadataModel1(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + 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:https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + """ + labels: Optional[Dict[str, str]] = None + """ + Map of string keys and values that can be used to organize and categorize + (scope and select) objects. Labels will be merged with internal labels + used by crossplane, and labels with a crossplane.io key might be + overwritten. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + name: Optional[str] = None + """ + Name is the name of the object. + """ + + +class ServiceAccountTemplate(BaseModel): + metadata: Optional[MetadataModel1] = None + """ + Metadata contains the configurable metadata fields for the ServiceAccount. + """ + + +class ServiceTemplate(BaseModel): + metadata: Optional[MetadataModel1] = None + """ + Metadata contains the configurable metadata fields for the Service. + """ + + +class SpecModel2(BaseModel): + deploymentTemplate: Optional[DeploymentTemplate] = None + """ + DeploymentTemplate is the template for the Deployment object. + """ + serviceAccountTemplate: Optional[ServiceAccountTemplate] = None + """ + ServiceAccountTemplate is the template for the ServiceAccount object. + """ + serviceTemplate: Optional[ServiceTemplate] = None + """ + ServiceTemplate is the template for the Service object. + """ + + +class DeploymentRuntimeConfig(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1beta1']] = ( + 'pkg.crossplane.io/v1beta1' + ) + """ + 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[Literal['DeploymentRuntimeConfig']] = 'DeploymentRuntimeConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[SpecModel2] = None + """ + DeploymentRuntimeConfigSpec specifies the configuration for a packaged controller. + Values provided will override package manager defaults. Labels and + annotations are passed to both the controller Deployment and ServiceAccount. + """ + + +class DeploymentRuntimeConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[DeploymentRuntimeConfig] + """ + List of deploymentruntimeconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/function/__init__.py b/schemas/python/models/io/crossplane/pkg/function/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/function/v1.py b/schemas/python/models/io/crossplane/pkg/function/v1.py new file mode 100644 index 000000000..80f7f408e --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/function/v1.py @@ -0,0 +1,213 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1_function.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class RuntimeConfigRef(BaseModel): + apiVersion: Optional[str] = 'pkg.crossplane.io/v1beta1' + """ + API version of the referent. + """ + kind: Optional[str] = 'DeploymentRuntimeConfig' + """ + Kind of the referent. + """ + name: str + """ + Name of the RuntimeConfig. + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + package: str + """ + Package is the name of the package that is being requested. + must be a fully qualified image name, including the registry, + repository, and tag. for example, "registry.example.com/repo/package:tag". + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be used + to fetch packages from private registries. + """ + revisionActivationPolicy: Optional[str] = 'Automatic' + """ + RevisionActivationPolicy specifies how the package controller should + update from one revision to the next. Options are Automatic or Manual. + Default is Automatic. + """ + revisionHistoryLimit: Optional[int] = 1 + """ + RevisionHistoryLimit dictates how the package controller cleans up old + inactive package revisions. + Defaults to 1. Can be disabled by explicitly setting to 0. + """ + runtimeConfigRef: Optional[RuntimeConfigRef] = Field( + default_factory=lambda: RuntimeConfigRef.model_validate({'name': 'default'}) + ) + """ + RuntimeConfigRef references a RuntimeConfig resource that will be used + to configure the package runtime. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this package, and what they were used for. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + currentIdentifier: Optional[str] = None + """ + CurrentIdentifier is the most recent package source that was used to + produce a revision. The package manager uses this field to determine + whether to check for package updates for a given source when + packagePullPolicy is set to IfNotPresent. Manually removing this field + will cause the package manager to check that the current revision is + correct for the given package source. + """ + currentRevision: Optional[str] = None + """ + CurrentRevision is the name of the current package revision. It will + reflect the most up to date revision, whether it has been activated or + not. + """ + resolvedPackage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was used for version + resolution. It may be different from spec.package if the package path was + rewritten using an image config. + """ + + +class Function(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1']] = 'pkg.crossplane.io/v1' + """ + 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[Literal['Function']] = 'Function' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + FunctionSpec specifies the configuration of a Function. + """ + status: Optional[Status] = None + """ + FunctionStatus represents the observed state of a Function. + """ + + +class FunctionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Function] + """ + List of functions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/function/v1beta1.py b/schemas/python/models/io/crossplane/pkg/function/v1beta1.py new file mode 100644 index 000000000..33fc01469 --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/function/v1beta1.py @@ -0,0 +1,215 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1beta1_function.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class RuntimeConfigRef(BaseModel): + apiVersion: Optional[str] = 'pkg.crossplane.io/v1beta1' + """ + API version of the referent. + """ + kind: Optional[str] = 'DeploymentRuntimeConfig' + """ + Kind of the referent. + """ + name: str + """ + Name of the RuntimeConfig. + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + package: str + """ + Package is the name of the package that is being requested. + must be a fully qualified image name, including the registry, + repository, and tag. for example, "registry.example.com/repo/package:tag". + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be used + to fetch packages from private registries. + """ + revisionActivationPolicy: Optional[str] = 'Automatic' + """ + RevisionActivationPolicy specifies how the package controller should + update from one revision to the next. Options are Automatic or Manual. + Default is Automatic. + """ + revisionHistoryLimit: Optional[int] = 1 + """ + RevisionHistoryLimit dictates how the package controller cleans up old + inactive package revisions. + Defaults to 1. Can be disabled by explicitly setting to 0. + """ + runtimeConfigRef: Optional[RuntimeConfigRef] = Field( + default_factory=lambda: RuntimeConfigRef.model_validate({'name': 'default'}) + ) + """ + RuntimeConfigRef references a RuntimeConfig resource that will be used + to configure the package runtime. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this package, and what they were used for. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + currentIdentifier: Optional[str] = None + """ + CurrentIdentifier is the most recent package source that was used to + produce a revision. The package manager uses this field to determine + whether to check for package updates for a given source when + packagePullPolicy is set to IfNotPresent. Manually removing this field + will cause the package manager to check that the current revision is + correct for the given package source. + """ + currentRevision: Optional[str] = None + """ + CurrentRevision is the name of the current package revision. It will + reflect the most up to date revision, whether it has been activated or + not. + """ + resolvedPackage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was used for version + resolution. It may be different from spec.package if the package path was + rewritten using an image config. + """ + + +class Function(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1beta1']] = ( + 'pkg.crossplane.io/v1beta1' + ) + """ + 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[Literal['Function']] = 'Function' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + FunctionSpec specifies the configuration of a Function. + """ + status: Optional[Status] = None + """ + FunctionStatus represents the observed state of a Function. + """ + + +class FunctionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Function] + """ + List of functions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/functionrevision/__init__.py b/schemas/python/models/io/crossplane/pkg/functionrevision/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/functionrevision/v1.py b/schemas/python/models/io/crossplane/pkg/functionrevision/v1.py new file mode 100644 index 000000000..a8365cf9a --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/functionrevision/v1.py @@ -0,0 +1,255 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1_functionrevision.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class RuntimeConfigRef(BaseModel): + apiVersion: Optional[str] = 'pkg.crossplane.io/v1beta1' + """ + API version of the referent. + """ + kind: Optional[str] = 'DeploymentRuntimeConfig' + """ + Kind of the referent. + """ + name: str + """ + Name of the RuntimeConfig. + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + desiredState: str + """ + DesiredState of the PackageRevision. Can be either Active or Inactive. + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + image: str + """ + Package image used by install Pod to extract package contents. + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. It is also + applied to any images pulled for the package, such as a provider's + controller image. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be + used to fetch packages from private registries. They are also applied to + any images pulled for the package, such as a provider's controller image. + """ + revision: int + """ + Revision number. Indicates when the revision will be garbage collected + based on the parent's RevisionHistoryLimit. + """ + runtimeConfigRef: Optional[RuntimeConfigRef] = Field( + default_factory=lambda: RuntimeConfigRef.model_validate({'name': 'default'}) + ) + """ + RuntimeConfigRef references a RuntimeConfig resource that will be used + to configure the package runtime. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + tlsClientSecretName: Optional[str] = None + """ + TLSClientSecretName is the name of the TLS Secret that stores client + certificates of the Provider. + """ + tlsServerSecretName: Optional[str] = None + """ + TLSServerSecretName is the name of the TLS Secret that stores server + certificates of the Provider. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class ObjectRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this revision, and what they were used for. + """ + capabilities: Optional[List[str]] = None + """ + Capabilities of this package. Capabilities are opaque strings that + may be meaningful to package consumers. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + endpoint: Optional[str] = None + """ + Endpoint is the gRPC endpoint where Crossplane will send + RunFunctionRequests. + """ + foundDependencies: Optional[int] = None + """ + Dependency information. + """ + installedDependencies: Optional[int] = None + invalidDependencies: Optional[int] = None + objectRefs: Optional[List[ObjectRef]] = None + """ + References to objects owned by PackageRevision. + """ + resolvedImage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was installed. It may be + different from spec.image if the package path was rewritten using an + image config. + """ + tlsClientSecretName: Optional[str] = None + """ + TLSClientSecretName is the name of the TLS Secret that stores client + certificates of the Provider. + """ + tlsServerSecretName: Optional[str] = None + """ + TLSServerSecretName is the name of the TLS Secret that stores server + certificates of the Provider. + """ + + +class FunctionRevision(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1']] = 'pkg.crossplane.io/v1' + """ + 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[Literal['FunctionRevision']] = 'FunctionRevision' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + FunctionRevisionSpec specifies configuration for a FunctionRevision. + """ + status: Optional[Status] = None + """ + FunctionRevisionStatus represents the observed state of a FunctionRevision. + """ + + +class FunctionRevisionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FunctionRevision] + """ + List of functionrevisions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/functionrevision/v1beta1.py b/schemas/python/models/io/crossplane/pkg/functionrevision/v1beta1.py new file mode 100644 index 000000000..8fbde7227 --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/functionrevision/v1beta1.py @@ -0,0 +1,257 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1beta1_functionrevision.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class RuntimeConfigRef(BaseModel): + apiVersion: Optional[str] = 'pkg.crossplane.io/v1beta1' + """ + API version of the referent. + """ + kind: Optional[str] = 'DeploymentRuntimeConfig' + """ + Kind of the referent. + """ + name: str + """ + Name of the RuntimeConfig. + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + desiredState: str + """ + DesiredState of the PackageRevision. Can be either Active or Inactive. + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + image: str + """ + Package image used by install Pod to extract package contents. + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. It is also + applied to any images pulled for the package, such as a provider's + controller image. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be + used to fetch packages from private registries. They are also applied to + any images pulled for the package, such as a provider's controller image. + """ + revision: int + """ + Revision number. Indicates when the revision will be garbage collected + based on the parent's RevisionHistoryLimit. + """ + runtimeConfigRef: Optional[RuntimeConfigRef] = Field( + default_factory=lambda: RuntimeConfigRef.model_validate({'name': 'default'}) + ) + """ + RuntimeConfigRef references a RuntimeConfig resource that will be used + to configure the package runtime. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + tlsClientSecretName: Optional[str] = None + """ + TLSClientSecretName is the name of the TLS Secret that stores client + certificates of the Provider. + """ + tlsServerSecretName: Optional[str] = None + """ + TLSServerSecretName is the name of the TLS Secret that stores server + certificates of the Provider. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class ObjectRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this revision, and what they were used for. + """ + capabilities: Optional[List[str]] = None + """ + Capabilities of this package. Capabilities are opaque strings that + may be meaningful to package consumers. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + endpoint: Optional[str] = None + """ + Endpoint is the gRPC endpoint where Crossplane will send + RunFunctionRequests. + """ + foundDependencies: Optional[int] = None + """ + Dependency information. + """ + installedDependencies: Optional[int] = None + invalidDependencies: Optional[int] = None + objectRefs: Optional[List[ObjectRef]] = None + """ + References to objects owned by PackageRevision. + """ + resolvedImage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was installed. It may be + different from spec.image if the package path was rewritten using an + image config. + """ + tlsClientSecretName: Optional[str] = None + """ + TLSClientSecretName is the name of the TLS Secret that stores client + certificates of the Provider. + """ + tlsServerSecretName: Optional[str] = None + """ + TLSServerSecretName is the name of the TLS Secret that stores server + certificates of the Provider. + """ + + +class FunctionRevision(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1beta1']] = ( + 'pkg.crossplane.io/v1beta1' + ) + """ + 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[Literal['FunctionRevision']] = 'FunctionRevision' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + FunctionRevisionSpec specifies configuration for a FunctionRevision. + """ + status: Optional[Status] = None + """ + FunctionRevisionStatus represents the observed state of a FunctionRevision. + """ + + +class FunctionRevisionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FunctionRevision] + """ + List of functionrevisions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/imageconfig/__init__.py b/schemas/python/models/io/crossplane/pkg/imageconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/imageconfig/v1beta1.py b/schemas/python/models/io/crossplane/pkg/imageconfig/v1beta1.py new file mode 100644 index 000000000..3fb641425 --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/imageconfig/v1beta1.py @@ -0,0 +1,252 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1beta1_imageconfig.yaml + +from __future__ import annotations + +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class MatchImage(BaseModel): + prefix: str + """ + Prefix is the prefix that should be matched. When multiple prefix rules + match an image path, the longest one takes precedence. + """ + type: Optional[Literal['Prefix']] = 'Prefix' + """ + Type is the type of match. + """ + + +class PullSecretRef(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class Authentication(BaseModel): + pullSecretRef: PullSecretRef + """ + PullSecretRef is a reference to a secret that contains the credentials for + the registry. + """ + + +class Registry(BaseModel): + authentication: Optional[Authentication] = None + """ + Authentication is the authentication information for the registry. + """ + + +class RewriteImage(BaseModel): + prefix: str + """ + Prefix is the prefix that will replace the portion of the image's path + matched by the prefix in the ImageMatch. If multiple prefixes matched, + the longest one will be replaced. + """ + + +class ConfigRef(BaseModel): + apiVersion: Optional[str] = 'pkg.crossplane.io/v1beta1' + """ + API version of the referent. + """ + kind: Optional[str] = 'DeploymentRuntimeConfig' + """ + Kind of the referent. + """ + name: str + """ + Name of the RuntimeConfig. + """ + + +class Runtime(BaseModel): + configRef: Optional[ConfigRef] = None + """ + ConfigReference references a RuntimeConfig resource that will be + used to configure the package runtime. + """ + + +class Attestation(BaseModel): + name: str + """ + Name of the attestation. + """ + predicateType: str + """ + PredicateType defines which predicate type to verify. Matches cosign + verify-attestation options. + """ + + +class SecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + + +class Key(BaseModel): + hashAlgorithm: str + """ + HashAlgorithm always defaults to sha256 if the algorithm hasn't been explicitly set + """ + secretRef: SecretRef + """ + SecretRef sets a reference to a secret with the key. + """ + + +class Identity(BaseModel): + issuer: Optional[str] = None + """ + Issuer defines the issuer for this identity. + """ + issuerRegExp: Optional[str] = None + """ + IssuerRegExp specifies a regular expression to match the issuer for this identity. + This has precedence over the Issuer field. + """ + subject: Optional[str] = None + """ + Subject defines the subject for this identity. + """ + subjectRegExp: Optional[str] = None + """ + SubjectRegExp specifies a regular expression to match the subject for this identity. + This has precedence over the Subject field. + """ + + +class Keyless(BaseModel): + identities: List[Identity] + """ + Identities sets a list of identities. + """ + insecureIgnoreSCT: Optional[bool] = None + """ + InsecureIgnoreSCT omits verifying if a certificate contains an embedded SCT + """ + + +class Authority(BaseModel): + attestations: Optional[List[Attestation]] = None + """ + Attestations is a list of individual attestations for this authority, + once the signature for this authority has been verified. + """ + key: Optional[Key] = None + """ + Key defines the type of key to validate the image. + """ + keyless: Optional[Keyless] = None + """ + Keyless sets the configuration to verify the authority against a Fulcio + instance. + """ + name: str + """ + Name is the name for this authority. + """ + + +class Cosign(BaseModel): + authorities: List[Authority] + """ + Authorities defines the rules for discovering and validating signatures. + """ + + +class Verification(BaseModel): + cosign: Optional[Cosign] = None + """ + Cosign is the configuration for verifying the image using cosign. + """ + provider: Literal['Cosign'] = 'Cosign' + """ + Provider is the provider that should be used to verify the image. + """ + + +class Spec(BaseModel): + matchImages: List[MatchImage] + """ + MatchImages is a list of image matching rules. This ImageConfig will + match an image if any one of these rules is satisfied. In the case where + multiple ImageConfigs match an image for a given purpose the one with the + most specific match will be used. If multiple rules of equal specificity + match an arbitrary one will be selected. + """ + registry: Optional[Registry] = None + """ + Registry is the configuration for the registry. + """ + rewriteImage: Optional[RewriteImage] = None + """ + RewriteImage defines how a matched image's path should be rewritten. + """ + runtime: Optional[Runtime] = None + """ + Runtime allows configuration of runtime options for the image. + """ + verification: Optional[Verification] = None + """ + Verification contains the configuration for verifying the image. + """ + + +class ImageConfig(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1beta1']] = ( + 'pkg.crossplane.io/v1beta1' + ) + """ + 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[Literal['ImageConfig']] = 'ImageConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + ImageConfigSpec contains the configuration for matching images. + """ + + +class ImageConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ImageConfig] + """ + List of imageconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/lock/__init__.py b/schemas/python/models/io/crossplane/pkg/lock/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/lock/v1beta1.py b/schemas/python/models/io/crossplane/pkg/lock/v1beta1.py new file mode 100644 index 000000000..6c17af80a --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/lock/v1beta1.py @@ -0,0 +1,151 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1beta1_lock.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class Dependency(BaseModel): + apiVersion: Optional[str] = None + """ + APIVersion of the package. + """ + constraints: str + """ + Constraints is a valid semver range or a digest, which will be used to select a valid + dependency version. + """ + kind: Optional[str] = None + """ + Kind of the package (not the kind of the package revision). + """ + package: str + """ + Package is the OCI image name without a tag or digest. + """ + type: Optional[Literal['Configuration', 'Provider', 'Function']] = None + """ + Type is the type of package. Can be either Configuration or Provider. + + Deprecated: Specify an apiVersion and kind instead. + """ + + +class Package(BaseModel): + apiVersion: Optional[str] = None + """ + APIVersion of the package. + """ + dependencies: List[Dependency] + """ + Dependencies are the list of dependencies of this package. The order of + the dependencies will dictate the order in which they are resolved. + """ + kind: Optional[str] = None + """ + Kind of the package (not the kind of the package revision). + """ + name: str + """ + Name corresponds to the name of the package revision for this package. + """ + source: str + """ + Source is the OCI image name without a tag or digest. + """ + type: Optional[Literal['Configuration', 'Provider', 'Function']] = None + """ + Type is the type of package. + + Deprecated: Specify an apiVersion and kind instead. + """ + version: str + """ + Version is the tag or digest of the OCI image. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class Lock(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1beta1']] = ( + 'pkg.crossplane.io/v1beta1' + ) + """ + 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[Literal['Lock']] = 'Lock' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + packages: Optional[List[Package]] = None + status: Optional[Status] = None + """ + Status of the Lock. + """ + + +class LockList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Lock] + """ + List of locks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/provider/__init__.py b/schemas/python/models/io/crossplane/pkg/provider/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/provider/v1.py b/schemas/python/models/io/crossplane/pkg/provider/v1.py new file mode 100644 index 000000000..18a054b46 --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/provider/v1.py @@ -0,0 +1,214 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1_provider.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class RuntimeConfigRef(BaseModel): + apiVersion: Optional[str] = 'pkg.crossplane.io/v1beta1' + """ + API version of the referent. + """ + kind: Optional[str] = 'DeploymentRuntimeConfig' + """ + Kind of the referent. + """ + name: str + """ + Name of the RuntimeConfig. + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + package: str + """ + Package is the name of the package that is being requested. + must be a fully qualified image name, including the registry, + repository, and tag. for example, "registry.example.com/repo/package:tag". + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be used + to fetch packages from private registries. + """ + revisionActivationPolicy: Optional[str] = 'Automatic' + """ + RevisionActivationPolicy specifies how the package controller should + update from one revision to the next. Options are Automatic or Manual. + Default is Automatic. + """ + revisionHistoryLimit: Optional[int] = 1 + """ + RevisionHistoryLimit dictates how the package controller cleans up old + inactive package revisions. + Defaults to 1. Can be disabled by explicitly setting to 0. + """ + runtimeConfigRef: Optional[RuntimeConfigRef] = Field( + default_factory=lambda: RuntimeConfigRef.model_validate({'name': 'default'}) + ) + """ + RuntimeConfigRef references a RuntimeConfig resource that will be used + to configure the package runtime. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this package, and what they were used for. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + currentIdentifier: Optional[str] = None + """ + CurrentIdentifier is the most recent package source that was used to + produce a revision. The package manager uses this field to determine + whether to check for package updates for a given source when + packagePullPolicy is set to IfNotPresent. Manually removing this field + will cause the package manager to check that the current revision is + correct for the given package source. + """ + currentRevision: Optional[str] = None + """ + CurrentRevision is the name of the current package revision. It will + reflect the most up to date revision, whether it has been activated or + not. + """ + resolvedPackage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was used for version + resolution. It may be different from spec.package if the package path was + rewritten using an image config. + """ + + +class Provider(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1']] = 'pkg.crossplane.io/v1' + """ + 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[Literal['Provider']] = 'Provider' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + ProviderSpec specifies details about a request to install a provider to + Crossplane. + """ + status: Optional[Status] = None + """ + ProviderStatus represents the observed state of a Provider. + """ + + +class ProviderList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Provider] + """ + List of providers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/pkg/providerrevision/__init__.py b/schemas/python/models/io/crossplane/pkg/providerrevision/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/pkg/providerrevision/v1.py b/schemas/python/models/io/crossplane/pkg/providerrevision/v1.py new file mode 100644 index 000000000..b5bb704ad --- /dev/null +++ b/schemas/python/models/io/crossplane/pkg/providerrevision/v1.py @@ -0,0 +1,250 @@ +# generated by datamodel-codegen: +# filename: workdir/pkg_crossplane_io_v1_providerrevision.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class PackagePullSecret(BaseModel): + name: Optional[str] = '' + """ + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + """ + + +class RuntimeConfigRef(BaseModel): + apiVersion: Optional[str] = 'pkg.crossplane.io/v1beta1' + """ + API version of the referent. + """ + kind: Optional[str] = 'DeploymentRuntimeConfig' + """ + Kind of the referent. + """ + name: str + """ + Name of the RuntimeConfig. + """ + + +class Spec(BaseModel): + commonLabels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + """ + desiredState: str + """ + DesiredState of the PackageRevision. Can be either Active or Inactive. + """ + ignoreCrossplaneConstraints: Optional[bool] = False + """ + IgnoreCrossplaneConstraints indicates to the package manager whether to + honor Crossplane version constrains specified by the package. + Default is false. + """ + image: str + """ + Package image used by install Pod to extract package contents. + """ + packagePullPolicy: Optional[str] = 'IfNotPresent' + """ + PackagePullPolicy defines the pull policy for the package. It is also + applied to any images pulled for the package, such as a provider's + controller image. + Default is IfNotPresent. + """ + packagePullSecrets: Optional[List[PackagePullSecret]] = None + """ + PackagePullSecrets are named secrets in the same namespace that can be + used to fetch packages from private registries. They are also applied to + any images pulled for the package, such as a provider's controller image. + """ + revision: int + """ + Revision number. Indicates when the revision will be garbage collected + based on the parent's RevisionHistoryLimit. + """ + runtimeConfigRef: Optional[RuntimeConfigRef] = Field( + default_factory=lambda: RuntimeConfigRef.model_validate({'name': 'default'}) + ) + """ + RuntimeConfigRef references a RuntimeConfig resource that will be used + to configure the package runtime. + """ + skipDependencyResolution: Optional[bool] = False + """ + SkipDependencyResolution indicates to the package manager whether to skip + resolving dependencies for a package. Setting this value to true may have + unintended consequences. + Default is false. + """ + tlsClientSecretName: Optional[str] = None + """ + TLSClientSecretName is the name of the TLS Secret that stores client + certificates of the Provider. + """ + tlsServerSecretName: Optional[str] = None + """ + TLSServerSecretName is the name of the TLS Secret that stores server + certificates of the Provider. + """ + + +class AppliedImageConfigRef(BaseModel): + name: str + """ + Name is the name of the image config. + """ + reason: str + """ + Reason indicates what the image config was used for. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class ObjectRef(BaseModel): + apiVersion: str + """ + APIVersion of the referenced object. + """ + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + uid: Optional[str] = None + """ + UID of the referenced object. + """ + + +class Status(BaseModel): + appliedImageConfigRefs: Optional[List[AppliedImageConfigRef]] = None + """ + AppliedImageConfigRefs records any image configs that were applied in + reconciling this revision, and what they were used for. + """ + capabilities: Optional[List[str]] = None + """ + Capabilities of this package. Capabilities are opaque strings that + may be meaningful to package consumers. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + foundDependencies: Optional[int] = None + """ + Dependency information. + """ + installedDependencies: Optional[int] = None + invalidDependencies: Optional[int] = None + objectRefs: Optional[List[ObjectRef]] = None + """ + References to objects owned by PackageRevision. + """ + resolvedImage: Optional[str] = None + """ + ResolvedPackage is the name of the package that was installed. It may be + different from spec.image if the package path was rewritten using an + image config. + """ + tlsClientSecretName: Optional[str] = None + """ + TLSClientSecretName is the name of the TLS Secret that stores client + certificates of the Provider. + """ + tlsServerSecretName: Optional[str] = None + """ + TLSServerSecretName is the name of the TLS Secret that stores server + certificates of the Provider. + """ + + +class ProviderRevision(BaseModel): + apiVersion: Optional[Literal['pkg.crossplane.io/v1']] = 'pkg.crossplane.io/v1' + """ + 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[Literal['ProviderRevision']] = 'ProviderRevision' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Optional[Spec] = None + """ + ProviderRevisionSpec specifies configuration for a ProviderRevision. + """ + status: Optional[Status] = None + """ + ProviderRevisionStatus represents the observed state of a ProviderRevision. + """ + + +class ProviderRevisionList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProviderRevision] + """ + List of providerrevisions. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/protection/__init__.py b/schemas/python/models/io/crossplane/protection/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/protection/clusterusage/__init__.py b/schemas/python/models/io/crossplane/protection/clusterusage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/protection/clusterusage/v1beta1.py b/schemas/python/models/io/crossplane/protection/clusterusage/v1beta1.py new file mode 100644 index 000000000..7062e14d4 --- /dev/null +++ b/schemas/python/models/io/crossplane/protection/clusterusage/v1beta1.py @@ -0,0 +1,174 @@ +# generated by datamodel-codegen: +# filename: workdir/protection_crossplane_io_v1beta1_clusterusage.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ResourceRef(BaseModel): + name: str + """ + Name of the referent. + """ + + +class ResourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + + +class By(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRef] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelector] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class Of(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRef] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelector] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class Spec(BaseModel): + by: Optional[By] = None + """ + By is the resource that is "using the other resource". + """ + of: Of + """ + Of is the resource that is "being used". + """ + reason: Optional[str] = None + """ + Reason is the reason for blocking deletion of the resource. + """ + replayDeletion: Optional[bool] = None + """ + ReplayDeletion will trigger a deletion on the used resource during the deletion of the usage itself, if it was attempted to be deleted at least once. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class ClusterUsage(BaseModel): + apiVersion: Optional[Literal['protection.crossplane.io/v1beta1']] = ( + 'protection.crossplane.io/v1beta1' + ) + """ + 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[Literal['ClusterUsage']] = 'ClusterUsage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ClusterUsageSpec defines the desired state of a ClusterUsage. + """ + status: Optional[Status] = None + """ + UsageStatus defines the observed state of Usage. + """ + + +class ClusterUsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ClusterUsage] + """ + List of clusterusages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/crossplane/protection/usage/__init__.py b/schemas/python/models/io/crossplane/protection/usage/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/crossplane/protection/usage/v1beta1.py b/schemas/python/models/io/crossplane/protection/usage/v1beta1.py new file mode 100644 index 000000000..19da04cd2 --- /dev/null +++ b/schemas/python/models/io/crossplane/protection/usage/v1beta1.py @@ -0,0 +1,202 @@ +# generated by datamodel-codegen: +# filename: workdir/protection_crossplane_io_v1beta1_usage.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel + +from ....k8s.apimachinery.pkg.apis.meta import v1 + + +class ResourceRef(BaseModel): + name: str + """ + Name of the referent. + """ + + +class ResourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + + +class By(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRef] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelector] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class ResourceRefModel(BaseModel): + name: str + """ + Name of the referent. + """ + namespace: Optional[str] = None + """ + Namespace of the referent. + """ + + +class ResourceSelectorModel(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace ensures an object in the supplied namespace is selected. + Omit namespace to only match resources in the Usage's namespace. + """ + + +class Of(BaseModel): + apiVersion: Optional[str] = None + """ + API version of the referent. + """ + kind: Optional[str] = None + """ + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + resourceRef: Optional[ResourceRefModel] = None + """ + Reference to the resource. + """ + resourceSelector: Optional[ResourceSelectorModel] = None + """ + Selector to the resource. + This field will be ignored if ResourceRef is set. + """ + + +class Spec(BaseModel): + by: Optional[By] = None + """ + By is the resource that is "using the other resource". + """ + of: Of + """ + Of is the resource that is "being used". + """ + reason: Optional[str] = None + """ + Reason is the reason for blocking deletion of the resource. + """ + replayDeletion: Optional[bool] = None + """ + ReplayDeletion will trigger a deletion on the used resource during the deletion of the usage itself, if it was attempted to be deleted at least once. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + + +class Usage(BaseModel): + apiVersion: Optional[Literal['protection.crossplane.io/v1beta1']] = ( + 'protection.crossplane.io/v1beta1' + ) + """ + 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[Literal['Usage']] = 'Usage' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + UsageSpec defines the desired state of Usage. + """ + status: Optional[Status] = None + """ + UsageStatus defines the observed state of Usage. + """ + + +class UsageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Usage] + """ + List of usages. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/k8s/__init__.py b/schemas/python/models/io/k8s/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/k8s/apimachinery/__init__.py b/schemas/python/models/io/k8s/apimachinery/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/k8s/apimachinery/pkg/__init__.py b/schemas/python/models/io/k8s/apimachinery/pkg/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/k8s/apimachinery/pkg/apis/__init__.py b/schemas/python/models/io/k8s/apimachinery/pkg/apis/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/__init__.py b/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py b/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py new file mode 100644 index 000000000..cc3f259fe --- /dev/null +++ b/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py @@ -0,0 +1,305 @@ +# generated by datamodel-codegen: +# filename: workdir/infrastructure_modelplane_ai_v1alpha1_gkecluster.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Optional + +from pydantic import BaseModel, Field, RootModel + + +class FieldsV1(BaseModel): + pass + + +class ListMeta(BaseModel): + continue_: Optional[str] = Field(None, alias='continue') + """ + 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. + """ + remainingItemCount: Optional[int] = None + """ + 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. + """ + resourceVersion: Optional[str] = None + """ + 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 + """ + selfLink: Optional[str] = None + """ + Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + """ + + +class OwnerReference(BaseModel): + apiVersion: str + """ + API version of the referent. + """ + blockOwnerDeletion: Optional[bool] = None + """ + 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. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. 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] = None + """ + If true, this reference points to the managing controller. + """ + kind: str + """ + Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + name: str + """ + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + """ + uid: str + """ + UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + """ + + +class Patch(BaseModel): + pass + + +class Preconditions(BaseModel): + resourceVersion: Optional[str] = None + """ + Specifies the target ResourceVersion + """ + uid: Optional[str] = None + """ + Specifies the target UID. + """ + + +class StatusCause(BaseModel): + field: Optional[str] = None + """ + 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. + + Examples: + "name" - the field "name" on the current resource + "items[0].name" - the field "name" on the first array entry in "items" + """ + message: Optional[str] = None + """ + A human-readable description of the cause of the error. This field may be presented as-is to a reader. + """ + reason: Optional[str] = None + """ + A machine-readable description of the cause of the error. If this value is empty there is no information available. + """ + + +class StatusDetails(BaseModel): + causes: Optional[List[StatusCause]] = None + """ + The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. + """ + group: Optional[str] = None + """ + The group attribute of the resource associated with the status StatusReason. + """ + kind: Optional[str] = None + """ + The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + name: Optional[str] = None + """ + The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). + """ + retryAfterSeconds: Optional[int] = None + """ + If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action. + """ + uid: Optional[str] = None + """ + UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + """ + + +class Time(RootModel[datetime]): + root: datetime + """ + 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 DeleteOptions(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + dryRun: Optional[List[str]] = None + """ + When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + """ + gracePeriodSeconds: Optional[int] = None + """ + The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + """ + ignoreStoreReadErrorWithClusterBreakingPotential: Optional[bool] = None + """ + if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + """ + kind: Optional[str] = None + """ + 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 + """ + orphanDependents: Optional[bool] = None + """ + Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + """ + preconditions: Optional[Preconditions] = None + """ + Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + """ + propagationPolicy: Optional[str] = None + """ + Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + """ + + +class ManagedFieldsEntry(BaseModel): + apiVersion: Optional[str] = None + """ + 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. + """ + fieldsType: Optional[str] = None + """ + FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: "FieldsV1" + """ + fieldsV1: Optional[FieldsV1] = None + """ + FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. + """ + manager: Optional[str] = None + """ + Manager is an identifier of the workflow managing these fields. + """ + operation: Optional[str] = None + """ + 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] = None + """ + 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] = None + """ + Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over. + """ + + +class ObjectMeta(BaseModel): + annotations: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations + """ + creationTimestamp: Optional[Time] = None + """ + 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. + + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + deletionGracePeriodSeconds: Optional[int] = None + """ + 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. + """ + deletionTimestamp: Optional[Time] = None + """ + 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. + + Populated 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]] = None + """ + 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. + """ + generateName: Optional[str] = None + """ + 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. + + If this field is specified and the generated name exists, the server will return a 409. + + Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + """ + generation: Optional[int] = None + """ + A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + """ + labels: Optional[Dict[str, str]] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + """ + managedFields: Optional[List[ManagedFieldsEntry]] = None + """ + 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] = None + """ + 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: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + """ + namespace: Optional[str] = None + """ + 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. + + Must be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces + """ + ownerReferences: Optional[List[OwnerReference]] = None + """ + 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. + """ + resourceVersion: Optional[str] = None + """ + 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. + + Populated 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 + """ + selfLink: Optional[str] = None + """ + Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + """ + uid: Optional[str] = None + """ + 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. + + Populated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + """ + + +class Status(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + code: Optional[int] = None + """ + Suggested HTTP return code for this status, 0 if not set. + """ + details: Optional[StatusDetails] = None + """ + Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. + """ + kind: Optional[str] = None + """ + 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 + """ + message: Optional[str] = None + """ + A human-readable description of the status of this operation. + """ + metadata: Optional[ListMeta] = {} + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ + reason: Optional[str] = None + """ + A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. + """ + status: Optional[str] = None + """ + Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + """ diff --git a/schemas/python/models/io/upbound/__init__.py b/schemas/python/models/io/upbound/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/__init__.py b/schemas/python/models/io/upbound/gcp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/folder/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/folder/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/folder/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/folder/v1beta1.py new file mode 100644 index 000000000..f6c3574a2 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/folder/v1beta1.py @@ -0,0 +1,321 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_folder.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ParentRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ParentSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + deletionProtection: Optional[bool] = None + """ + When the field is set to false, deleting the folder is allowed. Default value is true. + """ + displayName: Optional[str] = None + """ + The folder’s display name. + A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. + """ + parent: Optional[str] = None + """ + The resource name of the parent Folder or Organization. + Must be of the form folders/{folder_id} or organizations/{org_id}. + """ + parentRef: Optional[ParentRef] = None + """ + Reference to a Folder in cloudplatform to populate parent. + """ + parentSelector: Optional[ParentSelector] = None + """ + Selector for a Folder in cloudplatform to populate parent. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class InitProvider(BaseModel): + deletionProtection: Optional[bool] = None + """ + When the field is set to false, deleting the folder is allowed. Default value is true. + """ + displayName: Optional[str] = None + """ + The folder’s display name. + A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. + """ + parent: Optional[str] = None + """ + The resource name of the parent Folder or Organization. + Must be of the form folders/{folder_id} or organizations/{org_id}. + """ + parentRef: Optional[ParentRef] = None + """ + Reference to a Folder in cloudplatform to populate parent. + """ + parentSelector: Optional[ParentSelector] = None + """ + Selector for a Folder in cloudplatform to populate parent. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + createTime: Optional[str] = None + """ + Timestamp when the Folder was created. Assigned by the server. + A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". + """ + deletionProtection: Optional[bool] = None + """ + When the field is set to false, deleting the folder is allowed. Default value is true. + """ + displayName: Optional[str] = None + """ + The folder’s display name. + A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. + """ + folderId: Optional[str] = None + """ + The folder id from the name "folders/{folder_id}" + """ + id: Optional[str] = None + lifecycleState: Optional[str] = None + """ + The lifecycle state of the folder such as ACTIVE or DELETE_REQUESTED. + """ + name: Optional[str] = None + """ + The resource name of the Folder. Its format is folders/{folder_id}. + """ + parent: Optional[str] = None + """ + The resource name of the parent Folder or Organization. + Must be of the form folders/{folder_id} or organizations/{org_id}. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Folder(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Folder']] = 'Folder' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FolderSpec defines the desired state of Folder + """ + status: Optional[Status] = None + """ + FolderStatus defines the observed state of Folder. + """ + + +class FolderList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Folder] + """ + List of folders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta1.py new file mode 100644 index 000000000..1ad660dcb --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta1.py @@ -0,0 +1,269 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_folderiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FolderRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FolderSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + folder: Optional[str] = None + folderRef: Optional[FolderRef] = None + """ + Reference to a Folder in cloudplatform to populate folder. + """ + folderSelector: Optional[FolderSelector] = None + """ + Selector for a Folder in cloudplatform to populate folder. + """ + member: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + folder: Optional[str] = None + folderRef: Optional[FolderRef] = None + """ + Reference to a Folder in cloudplatform to populate folder. + """ + folderSelector: Optional[FolderSelector] = None + """ + Selector for a Folder in cloudplatform to populate folder. + """ + member: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + folder: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + role: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FolderIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['FolderIAMMember']] = 'FolderIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FolderIAMMemberSpec defines the desired state of FolderIAMMember + """ + status: Optional[Status] = None + """ + FolderIAMMemberStatus defines the observed state of FolderIAMMember. + """ + + +class FolderIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FolderIAMMember] + """ + List of folderiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta2.py new file mode 100644 index 000000000..4cae1a9fe --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/folderiammember/v1beta2.py @@ -0,0 +1,269 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta2_folderiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FolderRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FolderSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + folder: Optional[str] = None + folderRef: Optional[FolderRef] = None + """ + Reference to a Folder in cloudplatform to populate folder. + """ + folderSelector: Optional[FolderSelector] = None + """ + Selector for a Folder in cloudplatform to populate folder. + """ + member: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + folder: Optional[str] = None + folderRef: Optional[FolderRef] = None + """ + Reference to a Folder in cloudplatform to populate folder. + """ + folderSelector: Optional[FolderSelector] = None + """ + Selector for a Folder in cloudplatform to populate folder. + """ + member: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + folder: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FolderIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta2']] = ( + 'cloudplatform.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['FolderIAMMember']] = 'FolderIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FolderIAMMemberSpec defines the desired state of FolderIAMMember + """ + status: Optional[Status] = None + """ + FolderIAMMemberStatus defines the observed state of FolderIAMMember. + """ + + +class FolderIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FolderIAMMember] + """ + List of folderiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamauditconfig/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamauditconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py new file mode 100644 index 000000000..a264a4b75 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py @@ -0,0 +1,222 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_organizationiamauditconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AuditLogConfigItem(BaseModel): + exemptedMembers: Optional[List[str]] = None + logType: Optional[str] = None + + +class ForProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + orgId: Optional[str] = None + service: Optional[str] = None + + +class InitProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + orgId: Optional[str] = None + service: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + orgId: Optional[str] = None + service: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class OrganizationIAMAuditConfig(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['OrganizationIAMAuditConfig']] = 'OrganizationIAMAuditConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + OrganizationIAMAuditConfigSpec defines the desired state of OrganizationIAMAuditConfig + """ + status: Optional[Status] = None + """ + OrganizationIAMAuditConfigStatus defines the observed state of OrganizationIAMAuditConfig. + """ + + +class OrganizationIAMAuditConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[OrganizationIAMAuditConfig] + """ + List of organizationiamauditconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamcustomrole/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamcustomrole/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py new file mode 100644 index 000000000..44044e533 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py @@ -0,0 +1,296 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_organizationiamcustomrole.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization in which you want to create a custom role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + roleId: Optional[str] = None + """ + The role id to use for this role. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization in which you want to create a custom role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + roleId: Optional[str] = None + """ + The role id to use for this role. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deleted: Optional[bool] = None + """ + The current deleted state of the role. + """ + description: Optional[str] = None + """ + A human-readable description for the role. + """ + id: Optional[str] = None + """ + an identifier for the resource with the format organizations/{{org_id}}/roles/{{role_id}} + """ + name: Optional[str] = None + """ + The name of the role in the format organizations/{{org_id}}/roles/{{role_id}}. Like id, this field can be used as a reference in other resources such as IAM role bindings. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization in which you want to create a custom role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + roleId: Optional[str] = None + """ + The role id to use for this role. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class OrganizationIAMCustomRole(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['OrganizationIAMCustomRole']] = 'OrganizationIAMCustomRole' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + OrganizationIAMCustomRoleSpec defines the desired state of OrganizationIAMCustomRole + """ + status: Optional[Status] = None + """ + OrganizationIAMCustomRoleStatus defines the observed state of OrganizationIAMCustomRole. + """ + + +class OrganizationIAMCustomRoleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[OrganizationIAMCustomRole] + """ + List of organizationiamcustomroles. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta1.py new file mode 100644 index 000000000..6becd540d --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta1.py @@ -0,0 +1,226 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_organizationiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class OrganizationIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['OrganizationIAMMember']] = 'OrganizationIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + OrganizationIAMMemberSpec defines the desired state of OrganizationIAMMember + """ + status: Optional[Status] = None + """ + OrganizationIAMMemberStatus defines the observed state of OrganizationIAMMember. + """ + + +class OrganizationIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[OrganizationIAMMember] + """ + List of organizationiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta2.py new file mode 100644 index 000000000..db3590fc5 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/organizationiammember/v1beta2.py @@ -0,0 +1,226 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta2_organizationiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class OrganizationIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta2']] = ( + 'cloudplatform.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['OrganizationIAMMember']] = 'OrganizationIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + OrganizationIAMMemberSpec defines the desired state of OrganizationIAMMember + """ + status: Optional[Status] = None + """ + OrganizationIAMMemberStatus defines the observed state of OrganizationIAMMember. + """ + + +class OrganizationIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[OrganizationIAMMember] + """ + List of organizationiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/project/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/project/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/project/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/project/v1beta1.py new file mode 100644 index 000000000..1b8cdf5e7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/project/v1beta1.py @@ -0,0 +1,430 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_project.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FolderIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FolderIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoCreateNetwork: Optional[bool] = None + """ + Controls whether the 'default' network exists on the project. Defaults + to true, where it is created. Therefore, for quota purposes, you will still need to have 1 + network slot available to create the project successfully, even if you set auto_create_network to + false.googleapis.com on the project to interact + with the GCE API and currently leaves it enabled. + """ + billingAccount: Optional[str] = None + """ + The alphanumeric ID of the billing account this project + belongs to.user) on the billing account. + See Google Cloud Billing API Access Control + for more details. + """ + deletionPolicy: Optional[str] = None + """ + The deletion policy for the Project. Setting ABANDON allows the resource + to be abandoned rather than deleted, i.e. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is PREVENT. + """ + folderId: Optional[str] = None + """ + The numeric ID of the folder this project should be + created under. Only one of org_id or folder_id may be + specified. If the folder_id is specified, then the project is + created under the specified folder. Changing this forces the + project to be migrated to the newly specified folder. + """ + folderIdRef: Optional[FolderIdRef] = None + """ + Reference to a Folder in cloudplatform to populate folderId. + """ + folderIdSelector: Optional[FolderIdSelector] = None + """ + Selector for a Folder in cloudplatform to populate folderId. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to the project. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + name: Optional[str] = None + """ + The display name of the project. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization this project belongs to. + Changing this forces a new project to be created. Only one of + org_id or folder_id may be specified. If the org_id is + specified then the project is created at the top level. Changing + this forces the project to be migrated to the newly specified + organization. + The numeric ID of the organization this project belongs to. + """ + projectId: Optional[str] = None + """ + The project ID. Changing this forces a new project to be created. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class InitProvider(BaseModel): + autoCreateNetwork: Optional[bool] = None + """ + Controls whether the 'default' network exists on the project. Defaults + to true, where it is created. Therefore, for quota purposes, you will still need to have 1 + network slot available to create the project successfully, even if you set auto_create_network to + false.googleapis.com on the project to interact + with the GCE API and currently leaves it enabled. + """ + billingAccount: Optional[str] = None + """ + The alphanumeric ID of the billing account this project + belongs to.user) on the billing account. + See Google Cloud Billing API Access Control + for more details. + """ + deletionPolicy: Optional[str] = None + """ + The deletion policy for the Project. Setting ABANDON allows the resource + to be abandoned rather than deleted, i.e. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is PREVENT. + """ + folderId: Optional[str] = None + """ + The numeric ID of the folder this project should be + created under. Only one of org_id or folder_id may be + specified. If the folder_id is specified, then the project is + created under the specified folder. Changing this forces the + project to be migrated to the newly specified folder. + """ + folderIdRef: Optional[FolderIdRef] = None + """ + Reference to a Folder in cloudplatform to populate folderId. + """ + folderIdSelector: Optional[FolderIdSelector] = None + """ + Selector for a Folder in cloudplatform to populate folderId. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to the project. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + name: Optional[str] = None + """ + The display name of the project. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization this project belongs to. + Changing this forces a new project to be created. Only one of + org_id or folder_id may be specified. If the org_id is + specified then the project is created at the top level. Changing + this forces the project to be migrated to the newly specified + organization. + The numeric ID of the organization this project belongs to. + """ + projectId: Optional[str] = None + """ + The project ID. Changing this forces a new project to be created. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoCreateNetwork: Optional[bool] = None + """ + Controls whether the 'default' network exists on the project. Defaults + to true, where it is created. Therefore, for quota purposes, you will still need to have 1 + network slot available to create the project successfully, even if you set auto_create_network to + false.googleapis.com on the project to interact + with the GCE API and currently leaves it enabled. + """ + billingAccount: Optional[str] = None + """ + The alphanumeric ID of the billing account this project + belongs to.user) on the billing account. + See Google Cloud Billing API Access Control + for more details. + """ + deletionPolicy: Optional[str] = None + """ + The deletion policy for the Project. Setting ABANDON allows the resource + to be abandoned rather than deleted, i.e. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is PREVENT. + """ + effectiveLabels: Optional[Dict[str, str]] = None + folderId: Optional[str] = None + """ + The numeric ID of the folder this project should be + created under. Only one of org_id or folder_id may be + specified. If the folder_id is specified, then the project is + created under the specified folder. Changing this forces the + project to be migrated to the newly specified folder. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}} + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to the project. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + name: Optional[str] = None + """ + The display name of the project. + """ + number: Optional[str] = None + """ + The numeric identifier of the project. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization this project belongs to. + Changing this forces a new project to be created. Only one of + org_id or folder_id may be specified. If the org_id is + specified then the project is created at the top level. Changing + this forces the project to be migrated to the newly specified + organization. + The numeric ID of the organization this project belongs to. + """ + projectId: Optional[str] = None + """ + The project ID. Changing this forces a new project to be created. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Project(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Project']] = 'Project' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectSpec defines the desired state of Project + """ + status: Optional[Status] = None + """ + ProjectStatus defines the observed state of Project. + """ + + +class ProjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Project] + """ + List of projects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectdefaultserviceaccounts/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectdefaultserviceaccounts/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py new file mode 100644 index 000000000..3a9649653 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py @@ -0,0 +1,304 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_projectdefaultserviceaccounts.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + action: Optional[str] = None + """ + The action to be performed in the default service accounts. Valid values are: DEPRIVILEGE, DELETE, DISABLE. Note that DEPRIVILEGE action will ignore the REVERT configuration in the restore_policy + """ + project: Optional[str] = None + """ + The project ID where service accounts are created. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + restorePolicy: Optional[str] = None + """ + The action to be performed in the default service accounts on the resource destroy. + Valid values are NONE, REVERT and REVERT_AND_IGNORE_FAILURE. It is applied for any action but in the DEPRIVILEGE. + If set to REVERT it attempts to restore all default SAs but the DEPRIVILEGE action. + If set to REVERT_AND_IGNORE_FAILURE it is the same behavior as REVERT but ignores errors returned by the API. + """ + + +class InitProvider(BaseModel): + action: Optional[str] = None + """ + The action to be performed in the default service accounts. Valid values are: DEPRIVILEGE, DELETE, DISABLE. Note that DEPRIVILEGE action will ignore the REVERT configuration in the restore_policy + """ + project: Optional[str] = None + """ + The project ID where service accounts are created. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + restorePolicy: Optional[str] = None + """ + The action to be performed in the default service accounts on the resource destroy. + Valid values are NONE, REVERT and REVERT_AND_IGNORE_FAILURE. It is applied for any action but in the DEPRIVILEGE. + If set to REVERT it attempts to restore all default SAs but the DEPRIVILEGE action. + If set to REVERT_AND_IGNORE_FAILURE it is the same behavior as REVERT but ignores errors returned by the API. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + action: Optional[str] = None + """ + The action to be performed in the default service accounts. Valid values are: DEPRIVILEGE, DELETE, DISABLE. Note that DEPRIVILEGE action will ignore the REVERT configuration in the restore_policy + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}} + """ + project: Optional[str] = None + """ + The project ID where service accounts are created. + """ + restorePolicy: Optional[str] = None + """ + The action to be performed in the default service accounts on the resource destroy. + Valid values are NONE, REVERT and REVERT_AND_IGNORE_FAILURE. It is applied for any action but in the DEPRIVILEGE. + If set to REVERT it attempts to restore all default SAs but the DEPRIVILEGE action. + If set to REVERT_AND_IGNORE_FAILURE it is the same behavior as REVERT but ignores errors returned by the API. + """ + serviceAccounts: Optional[Dict[str, str]] = None + """ + The Service Accounts changed by this resource. It is used for REVERT the action on the destroy. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectDefaultServiceAccounts(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectDefaultServiceAccounts']] = ( + 'ProjectDefaultServiceAccounts' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectDefaultServiceAccountsSpec defines the desired state of ProjectDefaultServiceAccounts + """ + status: Optional[Status] = None + """ + ProjectDefaultServiceAccountsStatus defines the observed state of ProjectDefaultServiceAccounts. + """ + + +class ProjectDefaultServiceAccountsList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectDefaultServiceAccounts] + """ + List of projectdefaultserviceaccounts. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamauditconfig/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamauditconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamauditconfig/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamauditconfig/v1beta1.py new file mode 100644 index 000000000..ba78ddd81 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamauditconfig/v1beta1.py @@ -0,0 +1,265 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_projectiamauditconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AuditLogConfigItem(BaseModel): + exemptedMembers: Optional[List[str]] = None + logType: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + + +class InitProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + project: Optional[str] = None + service: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectIAMAuditConfig(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectIAMAuditConfig']] = 'ProjectIAMAuditConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectIAMAuditConfigSpec defines the desired state of ProjectIAMAuditConfig + """ + status: Optional[Status] = None + """ + ProjectIAMAuditConfigStatus defines the observed state of ProjectIAMAuditConfig. + """ + + +class ProjectIAMAuditConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectIAMAuditConfig] + """ + List of projectiamauditconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamcustomrole/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamcustomrole/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamcustomrole/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamcustomrole/v1beta1.py new file mode 100644 index 000000000..fa3696f8f --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiamcustomrole/v1beta1.py @@ -0,0 +1,287 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_projectiamcustomrole.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + project: Optional[str] = None + """ + The project that the custom role will be created in. + Defaults to the provider project configuration. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + project: Optional[str] = None + """ + The project that the custom role will be created in. + Defaults to the provider project configuration. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deleted: Optional[bool] = None + """ + The current deleted state of the role. + """ + description: Optional[str] = None + """ + A human-readable description for the role. + """ + id: Optional[str] = None + """ + an identifier for the resource with the format projects/{{project}}/roles/{{role_id}} + """ + name: Optional[str] = None + """ + The name of the role in the format projects/{{project}}/roles/{{role_id}}. Like id, this field can be used as a reference in other resources such as IAM role bindings. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + project: Optional[str] = None + """ + The project that the custom role will be created in. + Defaults to the provider project configuration. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectIAMCustomRole(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectIAMCustomRole']] = 'ProjectIAMCustomRole' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectIAMCustomRoleSpec defines the desired state of ProjectIAMCustomRole + """ + status: Optional[Status] = None + """ + ProjectIAMCustomRoleStatus defines the observed state of ProjectIAMCustomRole. + """ + + +class ProjectIAMCustomRoleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectIAMCustomRole] + """ + List of projectiamcustomroles. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta1.py new file mode 100644 index 000000000..b43932bb7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta1.py @@ -0,0 +1,269 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_projectiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectIAMMember']] = 'ProjectIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectIAMMemberSpec defines the desired state of ProjectIAMMember + """ + status: Optional[Status] = None + """ + ProjectIAMMemberStatus defines the observed state of ProjectIAMMember. + """ + + +class ProjectIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectIAMMember] + """ + List of projectiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta2.py new file mode 100644 index 000000000..4d429b5be --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/projectiammember/v1beta2.py @@ -0,0 +1,269 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta2_projectiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta2']] = ( + 'cloudplatform.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['ProjectIAMMember']] = 'ProjectIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectIAMMemberSpec defines the desired state of ProjectIAMMember + """ + status: Optional[Status] = None + """ + ProjectIAMMemberStatus defines the observed state of ProjectIAMMember. + """ + + +class ProjectIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectIAMMember] + """ + List of projectiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectservice/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectservice/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectservice/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectservice/v1beta1.py new file mode 100644 index 000000000..d25c72ca6 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/projectservice/v1beta1.py @@ -0,0 +1,319 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_projectservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + disableDependentServices: Optional[bool] = None + """ + If true, services that are enabled + and which depend on this service should also be disabled when this service is + destroyed. If false or unset, an error will be returned if any enabled + services depend on this service when attempting to destroy it. + """ + disableOnDestroy: Optional[bool] = None + """ + Defaults to true. Most configurations should + set this to false; it should generally only be true or unset in configurations + that manage the google_project resource itself. + """ + project: Optional[str] = None + """ + The project ID. If not provided, the provider project + is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + """ + The service to enable. + """ + + +class InitProvider(BaseModel): + disableDependentServices: Optional[bool] = None + """ + If true, services that are enabled + and which depend on this service should also be disabled when this service is + destroyed. If false or unset, an error will be returned if any enabled + services depend on this service when attempting to destroy it. + """ + disableOnDestroy: Optional[bool] = None + """ + Defaults to true. Most configurations should + set this to false; it should generally only be true or unset in configurations + that manage the google_project resource itself. + """ + project: Optional[str] = None + """ + The project ID. If not provided, the provider project + is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + """ + The service to enable. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + disableDependentServices: Optional[bool] = None + """ + If true, services that are enabled + and which depend on this service should also be disabled when this service is + destroyed. If false or unset, an error will be returned if any enabled + services depend on this service when attempting to destroy it. + """ + disableOnDestroy: Optional[bool] = None + """ + Defaults to true. Most configurations should + set this to false; it should generally only be true or unset in configurations + that manage the google_project resource itself. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{service}} + """ + project: Optional[str] = None + """ + The project ID. If not provided, the provider project + is used. + """ + service: Optional[str] = None + """ + The service to enable. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectService(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectService']] = 'ProjectService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectServiceSpec defines the desired state of ProjectService + """ + status: Optional[Status] = None + """ + ProjectServiceStatus defines the observed state of ProjectService. + """ + + +class ProjectServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectService] + """ + List of projectservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectusageexportbucket/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectusageexportbucket/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/projectusageexportbucket/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/projectusageexportbucket/v1beta1.py new file mode 100644 index 000000000..a334241f1 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/projectusageexportbucket/v1beta1.py @@ -0,0 +1,329 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_projectusageexportbucket.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BucketNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BucketNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bucketName: Optional[str] = None + """ + : The bucket to store reports in. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + prefix: Optional[str] = None + """ + : A prefix for the reports, for instance, the project name. + """ + project: Optional[str] = None + """ + : The project to set the export bucket on. If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class InitProvider(BaseModel): + bucketName: Optional[str] = None + """ + : The bucket to store reports in. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + prefix: Optional[str] = None + """ + : A prefix for the reports, for instance, the project name. + """ + project: Optional[str] = None + """ + : The project to set the export bucket on. If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bucketName: Optional[str] = None + """ + : The bucket to store reports in. + """ + id: Optional[str] = None + prefix: Optional[str] = None + """ + : A prefix for the reports, for instance, the project name. + """ + project: Optional[str] = None + """ + : The project to set the export bucket on. If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectUsageExportBucket(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectUsageExportBucket']] = 'ProjectUsageExportBucket' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectUsageExportBucketSpec defines the desired state of ProjectUsageExportBucket + """ + status: Optional[Status] = None + """ + ProjectUsageExportBucketStatus defines the observed state of ProjectUsageExportBucket. + """ + + +class ProjectUsageExportBucketList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectUsageExportBucket] + """ + List of projectusageexportbuckets. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccount/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccount/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccount/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccount/v1beta1.py new file mode 100644 index 000000000..8bb56a339 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccount/v1beta1.py @@ -0,0 +1,300 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_serviceaccount.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + createIgnoreAlreadyExists: Optional[bool] = None + """ + If set to true, skip service account creation if a service account with the same email already exists. + """ + description: Optional[str] = None + """ + A text description of the service account. + Must be less than or equal to 256 UTF-8 bytes. + """ + disabled: Optional[bool] = None + """ + Whether a service account is disabled or not. Defaults to false. This field has no effect during creation. + Must be set after creation to disable a service account. + """ + displayName: Optional[str] = None + """ + The display name for the service account. + Can be updated without creating a new resource. + """ + project: Optional[str] = None + """ + The ID of the project that the service account will be created in. + Defaults to the provider project configuration. + """ + + +class InitProvider(BaseModel): + createIgnoreAlreadyExists: Optional[bool] = None + """ + If set to true, skip service account creation if a service account with the same email already exists. + """ + description: Optional[str] = None + """ + A text description of the service account. + Must be less than or equal to 256 UTF-8 bytes. + """ + disabled: Optional[bool] = None + """ + Whether a service account is disabled or not. Defaults to false. This field has no effect during creation. + Must be set after creation to disable a service account. + """ + displayName: Optional[str] = None + """ + The display name for the service account. + Can be updated without creating a new resource. + """ + project: Optional[str] = None + """ + The ID of the project that the service account will be created in. + Defaults to the provider project configuration. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + createIgnoreAlreadyExists: Optional[bool] = None + """ + If set to true, skip service account creation if a service account with the same email already exists. + """ + description: Optional[str] = None + """ + A text description of the service account. + Must be less than or equal to 256 UTF-8 bytes. + """ + disabled: Optional[bool] = None + """ + Whether a service account is disabled or not. Defaults to false. This field has no effect during creation. + Must be set after creation to disable a service account. + """ + displayName: Optional[str] = None + """ + The display name for the service account. + Can be updated without creating a new resource. + """ + email: Optional[str] = None + """ + The e-mail address of the service account. This value + should be referenced from any google_iam_policy data sources + that would grant the service account privileges. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/serviceAccounts/{{email}} + """ + member: Optional[str] = None + """ + The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions. + """ + name: Optional[str] = None + """ + The fully-qualified name of the service account. + """ + project: Optional[str] = None + """ + The ID of the project that the service account will be created in. + Defaults to the provider project configuration. + """ + uniqueId: Optional[str] = None + """ + The unique id of the service account. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAccount(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAccount']] = 'ServiceAccount' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAccountSpec defines the desired state of ServiceAccount + """ + status: Optional[Status] = None + """ + ServiceAccountStatus defines the observed state of ServiceAccount. + """ + + +class ServiceAccountList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAccount] + """ + List of serviceaccounts. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta1.py new file mode 100644 index 000000000..f2e0aa3db --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta1.py @@ -0,0 +1,269 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_serviceaccountiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ServiceAccountIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAccountIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAccountIAMMember']] = 'ServiceAccountIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAccountIAMMemberSpec defines the desired state of ServiceAccountIAMMember + """ + status: Optional[Status] = None + """ + ServiceAccountIAMMemberStatus defines the observed state of ServiceAccountIAMMember. + """ + + +class ServiceAccountIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAccountIAMMember] + """ + List of serviceaccountiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta2.py new file mode 100644 index 000000000..3642e87e2 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountiammember/v1beta2.py @@ -0,0 +1,269 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta2_serviceaccountiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ServiceAccountIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAccountIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta2']] = ( + 'cloudplatform.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['ServiceAccountIAMMember']] = 'ServiceAccountIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAccountIAMMemberSpec defines the desired state of ServiceAccountIAMMember + """ + status: Optional[Status] = None + """ + ServiceAccountIAMMemberStatus defines the observed state of ServiceAccountIAMMember. + """ + + +class ServiceAccountIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAccountIAMMember] + """ + List of serviceaccountiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountkey/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountkey/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountkey/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountkey/v1beta1.py new file mode 100644 index 000000000..2eb624243 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/serviceaccountkey/v1beta1.py @@ -0,0 +1,366 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_serviceaccountkey.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ServiceAccountIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + keepers: Optional[Dict[str, str]] = None + """ + Arbitrary map of values that, when changed, will trigger a new key to be generated. + """ + keyAlgorithm: Optional[str] = None + """ + The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. + Valid values are listed at + ServiceAccountPrivateKeyType + (only used on create) + """ + privateKeyType: Optional[str] = None + """ + The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format. + """ + publicKeyData: Optional[str] = None + """ + Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509_PEM and it conflicts with public_key_type and private_key_type. + """ + publicKeyType: Optional[str] = None + """ + The output format of the public key requested. TYPE_X509_PEM_FILE is the default output format. + """ + serviceAccountId: Optional[str] = None + """ + The Service account id of the Key. This can be a string in the format + {ACCOUNT} or projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. If the {ACCOUNT}-only syntax is used, either + the full email address of the service account or its name can be specified as a value, in which case the project will + automatically be inferred from the account. Otherwise, if the projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT} + syntax is used, the {ACCOUNT} specified can be the full email address of the service account or the service account's + unique id. Substituting - as a wildcard for the {PROJECT_ID} will infer the project from the account. + """ + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class InitProvider(BaseModel): + keepers: Optional[Dict[str, str]] = None + """ + Arbitrary map of values that, when changed, will trigger a new key to be generated. + """ + keyAlgorithm: Optional[str] = None + """ + The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. + Valid values are listed at + ServiceAccountPrivateKeyType + (only used on create) + """ + privateKeyType: Optional[str] = None + """ + The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format. + """ + publicKeyData: Optional[str] = None + """ + Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509_PEM and it conflicts with public_key_type and private_key_type. + """ + publicKeyType: Optional[str] = None + """ + The output format of the public key requested. TYPE_X509_PEM_FILE is the default output format. + """ + serviceAccountId: Optional[str] = None + """ + The Service account id of the Key. This can be a string in the format + {ACCOUNT} or projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. If the {ACCOUNT}-only syntax is used, either + the full email address of the service account or its name can be specified as a value, in which case the project will + automatically be inferred from the account. Otherwise, if the projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT} + syntax is used, the {ACCOUNT} specified can be the full email address of the service account or the service account's + unique id. Substituting - as a wildcard for the {PROJECT_ID} will infer the project from the account. + """ + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/serviceAccounts/{{account}}/keys/{{key}} + """ + keepers: Optional[Dict[str, str]] = None + """ + Arbitrary map of values that, when changed, will trigger a new key to be generated. + """ + keyAlgorithm: Optional[str] = None + """ + The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. + Valid values are listed at + ServiceAccountPrivateKeyType + (only used on create) + """ + name: Optional[str] = None + """ + The name used for this key pair + """ + privateKeyType: Optional[str] = None + """ + The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format. + """ + publicKey: Optional[str] = None + """ + The public key, base64 encoded + """ + publicKeyData: Optional[str] = None + """ + Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509_PEM and it conflicts with public_key_type and private_key_type. + """ + publicKeyType: Optional[str] = None + """ + The output format of the public key requested. TYPE_X509_PEM_FILE is the default output format. + """ + serviceAccountId: Optional[str] = None + """ + The Service account id of the Key. This can be a string in the format + {ACCOUNT} or projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. If the {ACCOUNT}-only syntax is used, either + the full email address of the service account or its name can be specified as a value, in which case the project will + automatically be inferred from the account. Otherwise, if the projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT} + syntax is used, the {ACCOUNT} specified can be the full email address of the service account or the service account's + unique id. Substituting - as a wildcard for the {PROJECT_ID} will infer the project from the account. + """ + validAfter: Optional[str] = None + """ + The key can be used after this timestamp. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". + """ + validBefore: Optional[str] = None + """ + The key can be used before this timestamp. + A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAccountKey(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAccountKey']] = 'ServiceAccountKey' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAccountKeySpec defines the desired state of ServiceAccountKey + """ + status: Optional[Status] = None + """ + ServiceAccountKeyStatus defines the observed state of ServiceAccountKey. + """ + + +class ServiceAccountKeyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAccountKey] + """ + List of serviceaccountkeys. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/servicenetworkingpeereddnsdomain/__init__.py b/schemas/python/models/io/upbound/gcp/cloudplatform/servicenetworkingpeereddnsdomain/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py b/schemas/python/models/io/upbound/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py new file mode 100644 index 000000000..bb4a20447 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py @@ -0,0 +1,256 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_upbound_io_v1beta1_servicenetworkingpeereddnsdomain.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + dnsSuffix: Optional[str] = None + """ + The DNS domain suffix of the peered DNS domain. Make sure to suffix with a . (dot). + """ + network: str + """ + The network in the consumer project. + """ + project: Optional[str] = None + """ + The producer project number. If not provided, the provider project is used. + """ + service: str + """ + Private service connection between service and consumer network, defaults to servicenetworking.googleapis.com + """ + + +class InitProvider(BaseModel): + dnsSuffix: Optional[str] = None + """ + The DNS domain suffix of the peered DNS domain. Make sure to suffix with a . (dot). + """ + project: Optional[str] = None + """ + The producer project number. If not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + dnsSuffix: Optional[str] = None + """ + The DNS domain suffix of the peered DNS domain. Make sure to suffix with a . (dot). + """ + id: Optional[str] = None + """ + an identifier for the resource with format services/{{service}}/projects/{{project}}/global/networks/{{network}}/peeredDnsDomains/{{name}} + """ + network: Optional[str] = None + """ + The network in the consumer project. + """ + parent: Optional[str] = None + """ + an identifier for the resource with format services/{{service}}/projects/{{project}}/global/networks/{{network}} + """ + project: Optional[str] = None + """ + The producer project number. If not provided, the provider project is used. + """ + service: Optional[str] = None + """ + Private service connection between service and consumer network, defaults to servicenetworking.googleapis.com + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceNetworkingPeeredDNSDomain(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceNetworkingPeeredDNSDomain']] = ( + 'ServiceNetworkingPeeredDNSDomain' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceNetworkingPeeredDNSDomainSpec defines the desired state of ServiceNetworkingPeeredDNSDomain + """ + status: Optional[Status] = None + """ + ServiceNetworkingPeeredDNSDomainStatus defines the observed state of ServiceNetworkingPeeredDNSDomain. + """ + + +class ServiceNetworkingPeeredDNSDomainList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceNetworkingPeeredDNSDomain] + """ + List of servicenetworkingpeereddnsdomains. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/__init__.py b/schemas/python/models/io/upbound/gcp/compute/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/address/__init__.py b/schemas/python/models/io/upbound/gcp/compute/address/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/address/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/address/v1beta1.py new file mode 100644 index 000000000..79054a21a --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/address/v1beta1.py @@ -0,0 +1,530 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_address.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + address: Optional[str] = None + """ + The static external IP address represented by this resource. + The IP address must be inside the specified subnetwork, + if any. Set by the API if undefined. + """ + addressType: Optional[str] = None + """ + The type of address to reserve. + Note: if you set this argument's value as INTERNAL you need to leave the network_tier argument unset in that resource block. + Default value is EXTERNAL. + Possible values are: INTERNAL, EXTERNAL. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + ipv6EndpointType: Optional[str] = None + """ + The endpoint type of this address, which should be VM or NETLB. This is + used for deciding which type of endpoint this address can be used after + the external IPv6 address reservation. + Possible values are: VM, NETLB. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the address. This field + can only be used with INTERNAL type with the VPC_PEERING and + IPSEC_INTERCONNECT purposes. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + The networking tier used for configuring this address. If this field is not + specified, it is assumed to be PREMIUM. + This argument should not be used when configuring Internal addresses, because network tier cannot be set for internal traffic; it's always Premium. + Possible values are: PREMIUM, STANDARD. + """ + prefixLength: Optional[float] = None + """ + The prefix length if the resource represents an IP range. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of this resource, which can be one of the following values. + """ + region: str + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + subnetwork: Optional[str] = None + """ + The URL of the subnetwork in which to reserve the address. If an IP + address is specified, it must be within the subnetwork's IP range. + This field can only be used with INTERNAL type with + GCE_ENDPOINT/DNS_RESOLVER purposes. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + address: Optional[str] = None + """ + The static external IP address represented by this resource. + The IP address must be inside the specified subnetwork, + if any. Set by the API if undefined. + """ + addressType: Optional[str] = None + """ + The type of address to reserve. + Note: if you set this argument's value as INTERNAL you need to leave the network_tier argument unset in that resource block. + Default value is EXTERNAL. + Possible values are: INTERNAL, EXTERNAL. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + ipv6EndpointType: Optional[str] = None + """ + The endpoint type of this address, which should be VM or NETLB. This is + used for deciding which type of endpoint this address can be used after + the external IPv6 address reservation. + Possible values are: VM, NETLB. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the address. This field + can only be used with INTERNAL type with the VPC_PEERING and + IPSEC_INTERCONNECT purposes. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + The networking tier used for configuring this address. If this field is not + specified, it is assumed to be PREMIUM. + This argument should not be used when configuring Internal addresses, because network tier cannot be set for internal traffic; it's always Premium. + Possible values are: PREMIUM, STANDARD. + """ + prefixLength: Optional[float] = None + """ + The prefix length if the resource represents an IP range. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of this resource, which can be one of the following values. + """ + subnetwork: Optional[str] = None + """ + The URL of the subnetwork in which to reserve the address. If an IP + address is specified, it must be within the subnetwork's IP range. + This field can only be used with INTERNAL type with + GCE_ENDPOINT/DNS_RESOLVER purposes. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + address: Optional[str] = None + """ + The static external IP address represented by this resource. + The IP address must be inside the specified subnetwork, + if any. Set by the API if undefined. + """ + addressType: Optional[str] = None + """ + The type of address to reserve. + Note: if you set this argument's value as INTERNAL you need to leave the network_tier argument unset in that resource block. + Default value is EXTERNAL. + Possible values are: INTERNAL, EXTERNAL. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/addresses/{{name}} + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + ipv6EndpointType: Optional[str] = None + """ + The endpoint type of this address, which should be VM or NETLB. This is + used for deciding which type of endpoint this address can be used after + the external IPv6 address reservation. + Possible values are: VM, NETLB. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the address. This field + can only be used with INTERNAL type with the VPC_PEERING and + IPSEC_INTERCONNECT purposes. + """ + networkTier: Optional[str] = None + """ + The networking tier used for configuring this address. If this field is not + specified, it is assumed to be PREMIUM. + This argument should not be used when configuring Internal addresses, because network tier cannot be set for internal traffic; it's always Premium. + Possible values are: PREMIUM, STANDARD. + """ + prefixLength: Optional[float] = None + """ + The prefix length if the resource represents an IP range. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of this resource, which can be one of the following values. + """ + region: Optional[str] = None + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subnetwork: Optional[str] = None + """ + The URL of the subnetwork in which to reserve the address. If an IP + address is specified, it must be within the subnetwork's IP range. + This field can only be used with INTERNAL type with + GCE_ENDPOINT/DNS_RESOLVER purposes. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + users: Optional[List[str]] = None + """ + The URLs of the resources that are using this address. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Address(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Address']] = 'Address' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + AddressSpec defines the desired state of Address + """ + status: Optional[Status] = None + """ + AddressStatus defines the observed state of Address. + """ + + +class AddressList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Address] + """ + List of addresses. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/attacheddisk/__init__.py b/schemas/python/models/io/upbound/gcp/compute/attacheddisk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/attacheddisk/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/attacheddisk/v1beta1.py new file mode 100644 index 000000000..2ab097991 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/attacheddisk/v1beta1.py @@ -0,0 +1,413 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_attacheddisk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class InstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + deviceName: Optional[str] = None + """ + Specifies a unique device name of your choice that is + reflected into the /dev/disk/by-id/google-* tree of a Linux operating + system running within the instance. This name can be used to + reference the device for mounting, resizing, and so on, from within + the instance. + """ + disk: Optional[str] = None + """ + name or self_link of the disk that will be attached. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + instance: Optional[str] = None + """ + name or self_link of the compute instance that the disk will be attached to. + If the self_link is provided then zone and project are extracted from the + self link. If only the name is used then zone and project must be defined + as properties on the resource or provider. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + interface: Optional[str] = None + """ + The disk interface used for attaching this disk. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE or + READ_ONLY. If not specified, the default is to attach the disk in + READ_WRITE mode. + """ + project: Optional[str] = None + """ + The project that the referenced compute instance is a part of. If instance is referenced by its + self_link the project defined in the link will take precedence. + """ + zone: Optional[str] = None + """ + The zone that the referenced compute instance is located within. If instance is referenced by its + self_link the zone defined in the link will take precedence. + """ + + +class InitProvider(BaseModel): + deviceName: Optional[str] = None + """ + Specifies a unique device name of your choice that is + reflected into the /dev/disk/by-id/google-* tree of a Linux operating + system running within the instance. This name can be used to + reference the device for mounting, resizing, and so on, from within + the instance. + """ + disk: Optional[str] = None + """ + name or self_link of the disk that will be attached. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + instance: Optional[str] = None + """ + name or self_link of the compute instance that the disk will be attached to. + If the self_link is provided then zone and project are extracted from the + self link. If only the name is used then zone and project must be defined + as properties on the resource or provider. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + interface: Optional[str] = None + """ + The disk interface used for attaching this disk. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE or + READ_ONLY. If not specified, the default is to attach the disk in + READ_WRITE mode. + """ + project: Optional[str] = None + """ + The project that the referenced compute instance is a part of. If instance is referenced by its + self_link the project defined in the link will take precedence. + """ + zone: Optional[str] = None + """ + The zone that the referenced compute instance is located within. If instance is referenced by its + self_link the zone defined in the link will take precedence. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deviceName: Optional[str] = None + """ + Specifies a unique device name of your choice that is + reflected into the /dev/disk/by-id/google-* tree of a Linux operating + system running within the instance. This name can be used to + reference the device for mounting, resizing, and so on, from within + the instance. + """ + disk: Optional[str] = None + """ + name or self_link of the disk that will be attached. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/disks/{{disk.name}} + """ + instance: Optional[str] = None + """ + name or self_link of the compute instance that the disk will be attached to. + If the self_link is provided then zone and project are extracted from the + self link. If only the name is used then zone and project must be defined + as properties on the resource or provider. + """ + interface: Optional[str] = None + """ + The disk interface used for attaching this disk. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE or + READ_ONLY. If not specified, the default is to attach the disk in + READ_WRITE mode. + """ + project: Optional[str] = None + """ + The project that the referenced compute instance is a part of. If instance is referenced by its + self_link the project defined in the link will take precedence. + """ + zone: Optional[str] = None + """ + The zone that the referenced compute instance is located within. If instance is referenced by its + self_link the zone defined in the link will take precedence. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class AttachedDisk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['AttachedDisk']] = 'AttachedDisk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + AttachedDiskSpec defines the desired state of AttachedDisk + """ + status: Optional[Status] = None + """ + AttachedDiskStatus defines the observed state of AttachedDisk. + """ + + +class AttachedDiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[AttachedDisk] + """ + List of attacheddisks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/autoscaler/__init__.py b/schemas/python/models/io/upbound/gcp/compute/autoscaler/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta1.py new file mode 100644 index 000000000..8db3f8d43 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta1.py @@ -0,0 +1,535 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_autoscaler.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CpuUtilizationItem(BaseModel): + predictiveMethod: Optional[str] = None + """ + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class LoadBalancingUtilizationItem(BaseModel): + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class MetricItem(BaseModel): + filter: Optional[str] = None + """ + A filter string to be used as the filter string for + a Stackdriver Monitoring TimeSeries.list API call. + This filter is used to select a specific TimeSeries for + the purpose of autoscaling and to determine whether the metric + is exporting per-instance or per-group data. + You can only use the AND operator for joining selectors. + You can only use direct equality comparison operator (=) without + any functions for each selector. + You can specify the metric in both the filter string and in the + metric field. However, if specified in both places, the metric must + be identical. + The monitored resource type determines what kind of values are + expected for the metric. If it is a gce_instance, the autoscaler + expects the metric to include a separate TimeSeries for each + instance in a group. In such a case, you cannot filter on resource + labels. + If the resource type is any other value, the autoscaler expects + this metric to contain values that apply to the entire autoscaled + instance group and resource label filtering can be performed to + point autoscaler at the correct TimeSeries to scale upon. + This is called a per-group metric for the purpose of autoscaling. + If not specified, the type defaults to gce_instance. + You should provide a filter that is selective enough to pick just + one TimeSeries for the autoscaled group or for each of the instances + (if you are using gce_instance resource type). If multiple + TimeSeries are returned upon the query execution, the autoscaler + will sum their respective values to obtain its scaling value. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + singleInstanceAssignment: Optional[float] = None + """ + If scaling is based on a per-group metric value that represents the + total amount of work to be done or resource usage, set this value to + an amount assigned for a single instance of the scaled group. + The autoscaler will keep the number of instances proportional to the + value of this metric, the metric itself should not change value due + to group resizing. + For example, a good metric to use with the target is + pubsub.googleapis.com/subscription/num_undelivered_messages + or a custom metric exporting the total number of requests coming to + your instances. + A bad example would be a metric exporting an average or median + latency, since this value can't include a chunk assignable to a + single instance, it could be better used with utilization_target + instead. + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + type: Optional[str] = None + """ + Defines how target utilization value is expressed for a + Stackdriver Monitoring metric. + Possible values are: GAUGE, DELTA_PER_SECOND, DELTA_PER_MINUTE. + """ + + +class MaxScaledInReplica(BaseModel): + fixed: Optional[float] = None + """ + Specifies a fixed number of VM instances. This must be a positive + integer. + """ + percent: Optional[float] = None + """ + Specifies a percentage of instances between 0 to 100%, inclusive. + For example, specify 80 for 80%. + """ + + +class ScaleInControlItem(BaseModel): + maxScaledInReplicas: Optional[List[MaxScaledInReplica]] = None + """ + A nested object resource + Structure is documented below. + """ + timeWindowSec: Optional[float] = None + """ + How long back autoscaling should look when computing recommendations + to include directives regarding slower scale down, as described above. + """ + + +class ScalingSchedule(BaseModel): + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + disabled: Optional[bool] = None + """ + A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. + """ + durationSec: Optional[float] = None + """ + The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. + """ + minRequiredReplicas: Optional[float] = None + """ + Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + schedule: Optional[str] = None + """ + The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). + """ + timeZone: Optional[str] = None + """ + The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + + +class AutoscalingPolicyItem(BaseModel): + cooldownPeriod: Optional[float] = None + """ + The number of seconds that the autoscaler should wait before it + starts collecting information from a new instance. This prevents + the autoscaler from collecting information when the instance is + initializing, during which the collected usage would not be + reliable. The default time autoscaler waits is 60 seconds. + Virtual machine initialization times might vary because of + numerous factors. We recommend that you test how long an + instance may take to initialize. To do this, create an instance + and time the startup process. + """ + cpuUtilization: Optional[List[CpuUtilizationItem]] = None + """ + Defines the CPU utilization policy that allows the autoscaler to + scale based on the average CPU utilization of a managed instance + group. + Structure is documented below. + """ + loadBalancingUtilization: Optional[List[LoadBalancingUtilizationItem]] = None + """ + Configuration parameters of autoscaling based on a load balancer. + Structure is documented below. + """ + maxReplicas: Optional[float] = None + """ + The maximum number of instances that the autoscaler can scale up + to. This is required when creating or updating an autoscaler. The + maximum number of replicas should not be lower than minimal number + of replicas. + """ + metric: Optional[List[MetricItem]] = None + """ + Configuration parameters of autoscaling based on a custom metric. + Structure is documented below. + """ + minReplicas: Optional[float] = None + """ + The minimum number of replicas that the autoscaler can scale down + to. This cannot be less than 0. If not provided, autoscaler will + choose a default value depending on maximum number of instances + allowed. + """ + mode: Optional[str] = None + """ + Defines operating mode for this policy. + """ + scaleInControl: Optional[List[ScaleInControlItem]] = None + """ + Defines scale in controls to reduce the risk of response latency + and outages due to abrupt scale-in events + Structure is documented below. + """ + scalingSchedules: Optional[List[ScalingSchedule]] = None + """ + Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a InstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate target. + """ + zone: str + """ + URL of the zone where the instance group resides. + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a InstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/autoscalers/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + zone: Optional[str] = None + """ + URL of the zone where the instance group resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Autoscaler(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Autoscaler']] = 'Autoscaler' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + AutoscalerSpec defines the desired state of Autoscaler + """ + status: Optional[Status] = None + """ + AutoscalerStatus defines the observed state of Autoscaler. + """ + + +class AutoscalerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Autoscaler] + """ + List of autoscalers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta2.py new file mode 100644 index 000000000..4b1971dd7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/autoscaler/v1beta2.py @@ -0,0 +1,535 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_autoscaler.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CpuUtilization(BaseModel): + predictiveMethod: Optional[str] = None + """ + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class LoadBalancingUtilization(BaseModel): + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class MetricItem(BaseModel): + filter: Optional[str] = None + """ + A filter string to be used as the filter string for + a Stackdriver Monitoring TimeSeries.list API call. + This filter is used to select a specific TimeSeries for + the purpose of autoscaling and to determine whether the metric + is exporting per-instance or per-group data. + You can only use the AND operator for joining selectors. + You can only use direct equality comparison operator (=) without + any functions for each selector. + You can specify the metric in both the filter string and in the + metric field. However, if specified in both places, the metric must + be identical. + The monitored resource type determines what kind of values are + expected for the metric. If it is a gce_instance, the autoscaler + expects the metric to include a separate TimeSeries for each + instance in a group. In such a case, you cannot filter on resource + labels. + If the resource type is any other value, the autoscaler expects + this metric to contain values that apply to the entire autoscaled + instance group and resource label filtering can be performed to + point autoscaler at the correct TimeSeries to scale upon. + This is called a per-group metric for the purpose of autoscaling. + If not specified, the type defaults to gce_instance. + You should provide a filter that is selective enough to pick just + one TimeSeries for the autoscaled group or for each of the instances + (if you are using gce_instance resource type). If multiple + TimeSeries are returned upon the query execution, the autoscaler + will sum their respective values to obtain its scaling value. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + singleInstanceAssignment: Optional[float] = None + """ + If scaling is based on a per-group metric value that represents the + total amount of work to be done or resource usage, set this value to + an amount assigned for a single instance of the scaled group. + The autoscaler will keep the number of instances proportional to the + value of this metric, the metric itself should not change value due + to group resizing. + For example, a good metric to use with the target is + pubsub.googleapis.com/subscription/num_undelivered_messages + or a custom metric exporting the total number of requests coming to + your instances. + A bad example would be a metric exporting an average or median + latency, since this value can't include a chunk assignable to a + single instance, it could be better used with utilization_target + instead. + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + type: Optional[str] = None + """ + Defines how target utilization value is expressed for a + Stackdriver Monitoring metric. + Possible values are: GAUGE, DELTA_PER_SECOND, DELTA_PER_MINUTE. + """ + + +class MaxScaledInReplicas(BaseModel): + fixed: Optional[float] = None + """ + Specifies a fixed number of VM instances. This must be a positive + integer. + """ + percent: Optional[float] = None + """ + Specifies a percentage of instances between 0 to 100%, inclusive. + For example, specify 80 for 80%. + """ + + +class ScaleInControl(BaseModel): + maxScaledInReplicas: Optional[MaxScaledInReplicas] = None + """ + A nested object resource. + Structure is documented below. + """ + timeWindowSec: Optional[float] = None + """ + How long back autoscaling should look when computing recommendations + to include directives regarding slower scale down, as described above. + """ + + +class ScalingSchedule(BaseModel): + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + disabled: Optional[bool] = None + """ + A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. + """ + durationSec: Optional[float] = None + """ + The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. + """ + minRequiredReplicas: Optional[float] = None + """ + Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + schedule: Optional[str] = None + """ + The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). + """ + timeZone: Optional[str] = None + """ + The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + + +class AutoscalingPolicy(BaseModel): + cooldownPeriod: Optional[float] = None + """ + The number of seconds that the autoscaler should wait before it + starts collecting information from a new instance. This prevents + the autoscaler from collecting information when the instance is + initializing, during which the collected usage would not be + reliable. The default time autoscaler waits is 60 seconds. + Virtual machine initialization times might vary because of + numerous factors. We recommend that you test how long an + instance may take to initialize. To do this, create an instance + and time the startup process. + """ + cpuUtilization: Optional[CpuUtilization] = None + """ + Defines the CPU utilization policy that allows the autoscaler to + scale based on the average CPU utilization of a managed instance + group. + Structure is documented below. + """ + loadBalancingUtilization: Optional[LoadBalancingUtilization] = None + """ + Configuration parameters of autoscaling based on a load balancer. + Structure is documented below. + """ + maxReplicas: Optional[float] = None + """ + The maximum number of instances that the autoscaler can scale up + to. This is required when creating or updating an autoscaler. The + maximum number of replicas should not be lower than minimal number + of replicas. + """ + metric: Optional[List[MetricItem]] = None + """ + Configuration parameters of autoscaling based on a custom metric. + Structure is documented below. + """ + minReplicas: Optional[float] = None + """ + The minimum number of replicas that the autoscaler can scale down + to. This cannot be less than 0. If not provided, autoscaler will + choose a default value depending on maximum number of instances + allowed. + """ + mode: Optional[str] = None + """ + Defines operating mode for this policy. + """ + scaleInControl: Optional[ScaleInControl] = None + """ + Defines scale in controls to reduce the risk of response latency + and outages due to abrupt scale-in events + Structure is documented below. + """ + scalingSchedules: Optional[List[ScalingSchedule]] = None + """ + Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a InstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate target. + """ + zone: str + """ + URL of the zone where the instance group resides. + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a InstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/autoscalers/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + zone: Optional[str] = None + """ + URL of the zone where the instance group resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Autoscaler(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Autoscaler']] = 'Autoscaler' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + AutoscalerSpec defines the desired state of Autoscaler + """ + status: Optional[Status] = None + """ + AutoscalerStatus defines the observed state of Autoscaler. + """ + + +class AutoscalerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Autoscaler] + """ + List of autoscalers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/backendbucket/__init__.py b/schemas/python/models/io/upbound/gcp/compute/backendbucket/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta1.py new file mode 100644 index 000000000..39111f5c5 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta1.py @@ -0,0 +1,525 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_backendbucket.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BucketNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BucketNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BypassCacheOnRequestHeader(BaseModel): + headerName: Optional[str] = None + """ + The header field name to match on when bypassing cache. Values are case-insensitive. + """ + + +class CacheKeyPolicyItem(BaseModel): + includeHttpHeaders: Optional[List[str]] = None + """ + Allows HTTP request headers (by name) to be used in the + cache key. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + Default parameters are always included. '&' and '=' will + be percent encoded and not treated as delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + ttl: Optional[float] = None + """ + The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s + (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + """ + + +class CdnPolicyItem(BaseModel): + bypassCacheOnRequestHeaders: Optional[List[BypassCacheOnRequestHeader]] = None + """ + Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + Structure is documented below. + """ + cacheKeyPolicy: Optional[List[CacheKeyPolicyItem]] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + requestCoalescing: Optional[bool] = None + """ + If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request will + be considered fresh. After this time period, + the response will be revalidated before being served. + When serving responses to signed URL requests, + Cloud CDN will internally behave as though + all responses from this backend had a "Cache-Control: public, + max-age=[TTL]" header, regardless of any existing Cache-Control + header. The actual headers served in responses will not be altered. + """ + + +class EdgeSecurityPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EdgeSecurityPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + edgeSecurityPolicyRef: Optional[EdgeSecurityPolicyRef] = None + """ + Reference to a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + edgeSecurityPolicySelector: Optional[EdgeSecurityPolicySelector] = None + """ + Selector for a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + edgeSecurityPolicyRef: Optional[EdgeSecurityPolicyRef] = None + """ + Reference to a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + edgeSecurityPolicySelector: Optional[EdgeSecurityPolicySelector] = None + """ + Selector for a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendBuckets/{{name}} + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendBucket(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendBucket']] = 'BackendBucket' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendBucketSpec defines the desired state of BackendBucket + """ + status: Optional[Status] = None + """ + BackendBucketStatus defines the observed state of BackendBucket. + """ + + +class BackendBucketList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendBucket] + """ + List of backendbuckets. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta2.py new file mode 100644 index 000000000..d8632ef61 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/backendbucket/v1beta2.py @@ -0,0 +1,528 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_backendbucket.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BucketNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BucketNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BypassCacheOnRequestHeader(BaseModel): + headerName: Optional[str] = None + """ + The header field name to match on when bypassing cache. Values are case-insensitive. + """ + + +class CacheKeyPolicy(BaseModel): + includeHttpHeaders: Optional[List[str]] = None + """ + Allows HTTP request headers (by name) to be used in the + cache key. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + Default parameters are always included. '&' and '=' will + be percent encoded and not treated as delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + ttl: Optional[float] = None + """ + The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s + (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + """ + + +class CdnPolicy(BaseModel): + bypassCacheOnRequestHeaders: Optional[List[BypassCacheOnRequestHeader]] = None + """ + Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + Structure is documented below. + """ + cacheKeyPolicy: Optional[CacheKeyPolicy] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. When the + cache_mode is set to "USE_ORIGIN_HEADERS", you must omit this field. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). When the cache_mode + is set to "USE_ORIGIN_HEADERS", you must omit this field. + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. When the + cache_mode is set to "USE_ORIGIN_HEADERS", you must omit this field. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + requestCoalescing: Optional[bool] = None + """ + If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request will + be considered fresh. After this time period, + the response will be revalidated before being served. + When serving responses to signed URL requests, + Cloud CDN will internally behave as though + all responses from this backend had a "Cache-Control: public, + max-age=[TTL]" header, regardless of any existing Cache-Control + header. The actual headers served in responses will not be altered. + """ + + +class EdgeSecurityPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EdgeSecurityPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + edgeSecurityPolicyRef: Optional[EdgeSecurityPolicyRef] = None + """ + Reference to a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + edgeSecurityPolicySelector: Optional[EdgeSecurityPolicySelector] = None + """ + Selector for a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + edgeSecurityPolicyRef: Optional[EdgeSecurityPolicyRef] = None + """ + Reference to a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + edgeSecurityPolicySelector: Optional[EdgeSecurityPolicySelector] = None + """ + Selector for a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendBuckets/{{name}} + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendBucket(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['BackendBucket']] = 'BackendBucket' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendBucketSpec defines the desired state of BackendBucket + """ + status: Optional[Status] = None + """ + BackendBucketStatus defines the observed state of BackendBucket. + """ + + +class BackendBucketList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendBucket] + """ + List of backendbuckets. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/backendbucketsignedurlkey/__init__.py b/schemas/python/models/io/upbound/gcp/compute/backendbucketsignedurlkey/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/backendbucketsignedurlkey/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/backendbucketsignedurlkey/v1beta1.py new file mode 100644 index 000000000..b2deffa15 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/backendbucketsignedurlkey/v1beta1.py @@ -0,0 +1,319 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_backendbucketsignedurlkey.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendBucketRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendBucketSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class KeyValueSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class ForProvider(BaseModel): + backendBucket: Optional[str] = None + """ + The backend bucket this signed URL key belongs. + """ + backendBucketRef: Optional[BackendBucketRef] = None + """ + Reference to a BackendBucket in compute to populate backendBucket. + """ + backendBucketSelector: Optional[BackendBucketSelector] = None + """ + Selector for a BackendBucket in compute to populate backendBucket. + """ + keyValueSecretRef: Optional[KeyValueSecretRef] = None + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + backendBucket: Optional[str] = None + """ + The backend bucket this signed URL key belongs. + """ + backendBucketRef: Optional[BackendBucketRef] = None + """ + Reference to a BackendBucket in compute to populate backendBucket. + """ + backendBucketSelector: Optional[BackendBucketSelector] = None + """ + Selector for a BackendBucket in compute to populate backendBucket. + """ + keyValueSecretRef: KeyValueSecretRef + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendBucket: Optional[str] = None + """ + The backend bucket this signed URL key belongs. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendBuckets/{{backend_bucket}} + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendBucketSignedURLKey(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendBucketSignedURLKey']] = 'BackendBucketSignedURLKey' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendBucketSignedURLKeySpec defines the desired state of BackendBucketSignedURLKey + """ + status: Optional[Status] = None + """ + BackendBucketSignedURLKeyStatus defines the observed state of BackendBucketSignedURLKey. + """ + + +class BackendBucketSignedURLKeyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendBucketSignedURLKey] + """ + List of backendbucketsignedurlkeys. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/backendservice/__init__.py b/schemas/python/models/io/upbound/gcp/compute/backendservice/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta1.py new file mode 100644 index 000000000..a76e98b63 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta1.py @@ -0,0 +1,1865 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_backendservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CustomMetric(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BackendItem(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + For global HTTP(S) or TCP/SSL load balancing, the default is + UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)), + CUSTOM_METRICS (for HTTP(s)) and CONNECTION (for TCP/SSL). + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + Default value is 1, which means the group will serve up to 100% + of its configured capacity (depending on balancingMode). A + setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetric]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + groupRef: Optional[GroupRef] = None + """ + Reference to a InstanceGroupManager in compute to populate group. + """ + groupSelector: Optional[GroupSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate group. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either + maxConnections or maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. For RATE mode, either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + """ + preference: Optional[str] = None + """ + This field indicates whether this backend should be fully utilized before sending traffic to backends + with default preference. This field cannot be set when loadBalancingScheme is set to 'EXTERNAL'. The possible values are: + """ + + +class BypassCacheOnRequestHeader(BaseModel): + headerName: Optional[str] = None + """ + The header field name to match on when bypassing cache. Values are case-insensitive. + """ + + +class CacheKeyPolicyItem(BaseModel): + includeHost: Optional[bool] = None + """ + If true requests to different hosts will be cached separately. + """ + includeHttpHeaders: Optional[List[str]] = None + """ + Allows HTTP request headers (by name) to be used in the + cache key. + """ + includeNamedCookies: Optional[List[str]] = None + """ + Names of cookies to include in cache keys. + """ + includeProtocol: Optional[bool] = None + """ + If true, http and https requests will be cached separately. + """ + includeQueryString: Optional[bool] = None + """ + If true, include query string parameters in the cache key + according to query_string_whitelist and + query_string_blacklist. If neither is set, the entire query + string will be included. + If false, the query string will be excluded from the cache + key entirely. + """ + queryStringBlacklist: Optional[List[str]] = None + """ + Names of query string parameters to exclude in cache keys. + All other parameters will be included. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + All other parameters will be excluded. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + ttl: Optional[float] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class CdnPolicyItem(BaseModel): + bypassCacheOnRequestHeaders: Optional[List[BypassCacheOnRequestHeader]] = None + """ + Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. + The cache is bypassed for all cdnPolicy.cacheMode settings. + Structure is documented below. + """ + cacheKeyPolicy: Optional[List[CacheKeyPolicyItem]] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + requestCoalescing: Optional[bool] = None + """ + If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests + to the origin. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request + will be considered fresh, defaults to 1hr (3600s). After this + time period, the response will be revalidated before + being served. + When serving responses to signed URL requests, Cloud CDN will + internally behave as though all responses from this backend had a + "Cache-Control: public, max-age=[TTL]" header, regardless of any + existing Cache-Control header. The actual headers served in + responses will not be altered. + """ + + +class CircuitBreaker(BaseModel): + maxConnections: Optional[float] = None + """ + The maximum number of connections to the backend cluster. + Defaults to 1024. + """ + maxPendingRequests: Optional[float] = None + """ + The maximum number of pending requests to the backend cluster. + Defaults to 1024. + """ + maxRequests: Optional[float] = None + """ + The maximum number of parallel requests to the backend cluster. + Defaults to 1024. + """ + maxRequestsPerConnection: Optional[float] = None + """ + Maximum requests for a single backend connection. This parameter + is respected by both the HTTP/1.1 and HTTP/2 implementations. If + not specified, there is no limit. Setting this parameter to 1 + will effectively disable keep alive. + """ + maxRetries: Optional[float] = None + """ + The maximum number of parallel retries to the backend cluster. + Defaults to 3. + """ + + +class TtlItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class HttpCookieItem(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[List[TtlItem]] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ConsistentHashItem(BaseModel): + httpCookie: Optional[List[HttpCookieItem]] = None + """ + Hash is based on HTTP Cookie. This field describes a HTTP cookie + that will be used as the hash key for the consistent hash load + balancer. If the cookie is not present, it will be generated. + This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + Structure is documented below. + """ + httpHeaderName: Optional[str] = None + """ + The hash based on the value of the specified header field. + This field is applicable if the sessionAffinity is set to HEADER_FIELD. + """ + minimumRingSize: Optional[float] = None + """ + The minimum number of virtual nodes to use for the hash ring. + Larger ring sizes result in more granular load + distributions. If the number of hosts in the load balancing pool + is larger than the ring size, each host will be assigned a single + virtual node. + Defaults to 1024. + """ + + +class CustomMetricModel(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Oauth2ClientSecretSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class IapItem(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + oauth2ClientSecretSecretRef: Optional[Oauth2ClientSecretSecretRef] = None + """ + OAuth2 Client Secret for IAP + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class CustomPolicyItem(BaseModel): + data: Optional[str] = None + """ + An optional, arbitrary JSON object with configuration data, understood + by a locally installed custom policy implementation. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class PolicyItem(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class LocalityLbPolicy(BaseModel): + customPolicy: Optional[List[CustomPolicyItem]] = None + """ + The configuration for a custom policy implemented by the user and + deployed with the client. + Structure is documented below. + """ + policy: Optional[List[PolicyItem]] = None + """ + The configuration for a built-in load balancing policy. + Structure is documented below. + """ + + +class LogConfigItem(BaseModel): + enable: Optional[bool] = None + """ + Whether to enable logging for the load balancer traffic served by this backend service. + """ + optionalFields: Optional[List[str]] = None + """ + This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" + was set to CUSTOM. Contains a list of optional fields you want to include in the logs. + For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace + For example: orca_load_report, tls.protocol + """ + optionalMode: Optional[str] = None + """ + Specifies the optional logging mode for the load balancer traffic. + Supported values: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + Possible values are: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + """ + sampleRate: Optional[float] = None + """ + This field can only be specified if logging is enabled for this backend service. The value of + the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer + where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. + The default value is 1.0. + """ + + +class MaxStreamDurationItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. + Durations less than one second are represented with a 0 seconds field and a positive nanos field. + Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. (int64 format) + """ + + +class BaseEjectionTimeItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class IntervalItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class OutlierDetectionItem(BaseModel): + baseEjectionTime: Optional[List[BaseEjectionTimeItem]] = None + """ + The base time that a host is ejected for. The real time is equal to the base + time multiplied by the number of times the host has been ejected. Defaults to + 30000ms or 30s. + Structure is documented below. + """ + consecutiveErrors: Optional[float] = None + """ + Number of errors before a host is ejected from the connection pool. When the + backend host is accessed over HTTP, a 5xx return code qualifies as an error. + Defaults to 5. + """ + consecutiveGatewayFailure: Optional[float] = None + """ + The number of consecutive gateway failures (502, 503, 504 status or connection + errors that are mapped to one of those status codes) before a consecutive + gateway failure ejection occurs. Defaults to 5. + """ + enforcingConsecutiveErrors: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive 5xx. This setting can be used to disable + ejection or to ramp it up slowly. Defaults to 100. + """ + enforcingConsecutiveGatewayFailure: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive gateway failures. This setting can be + used to disable ejection or to ramp it up slowly. Defaults to 0. + """ + enforcingSuccessRate: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through success rate statistics. This setting can be used to + disable ejection or to ramp it up slowly. Defaults to 100. + """ + interval: Optional[List[IntervalItem]] = None + """ + Time interval between ejection sweep analysis. This can result in both new + ejections as well as hosts being returned to service. Defaults to 10 seconds. + Structure is documented below. + """ + maxEjectionPercent: Optional[float] = None + """ + Maximum percentage of hosts in the load balancing pool for the backend service + that can be ejected. Defaults to 10%. + """ + successRateMinimumHosts: Optional[float] = None + """ + The number of hosts in a cluster that must have enough request volume to detect + success rate outliers. If the number of hosts is less than this setting, outlier + detection via success rate statistics is not performed for any host in the + cluster. Defaults to 5. + """ + successRateRequestVolume: Optional[float] = None + """ + The minimum number of total requests that must be collected in one interval (as + defined by the interval duration above) to include this host in success rate + based outlier detection. If the volume is lower than this setting, outlier + detection via success rate statistics is not performed for that host. Defaults + to 100. + """ + successRateStdevFactor: Optional[float] = None + """ + This factor is used to determine the ejection threshold for success rate outlier + ejection. The ejection threshold is the difference between the mean success + rate, and the product of this factor and the standard deviation of the mean + success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided + by a thousand to get a double. That is, if the desired factor is 1.9, the + runtime value should be 1900. Defaults to 1900. + """ + + +class AccessKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class AwsV4AuthenticationItem(BaseModel): + accessKeyId: Optional[str] = None + """ + The identifier of an access key used for s3 bucket authentication. + """ + accessKeySecretRef: Optional[AccessKeySecretRef] = None + """ + The access key used for s3 bucket authentication. + Required for updating or creating a backend that uses AWS v4 signature authentication, but will not be returned as part of the configuration when queried with a REST API GET request. + Note: This property is sensitive and will not be displayed in the plan. + """ + accessKeyVersion: Optional[str] = None + """ + The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + """ + originRegion: Optional[str] = None + """ + The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. + For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + """ + + +class SecuritySetting(BaseModel): + awsV4Authentication: Optional[List[AwsV4AuthenticationItem]] = None + """ + The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. + Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends. + Structure is documented below. + """ + clientTlsPolicy: Optional[str] = None + """ + ClientTlsPolicy is a resource that specifies how a client should authenticate + connections to backends of a service. This resource itself does not affect + configuration unless it is attached to a backend service resource. + """ + subjectAltNames: Optional[List[str]] = None + """ + A list of alternate names to verify the subject identity in the certificate. + If specified, the client will verify that the server certificate's subject + alt name matches one of the specified values. + """ + + +class StrongSessionAffinityCookieItem(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[List[TtlItem]] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class SubjectAltName(BaseModel): + dnsName: Optional[str] = None + """ + The SAN specified as a DNS Name. + """ + uniformResourceIdentifier: Optional[str] = None + """ + The SAN specified as a URI. + """ + + +class TlsSetting(BaseModel): + authenticationConfig: Optional[str] = None + """ + Reference to the BackendAuthenticationConfig resource from the networksecurity.googleapis.com namespace. + Can be used in authenticating TLS connections to the backend, as specified by the authenticationMode field. + Can only be specified if authenticationMode is not NONE. + """ + sni: Optional[str] = None + """ + Server Name Indication - see RFC3546 section 3.1. If set, the load balancer sends this string as the SNI hostname in the + TLS connection to the backend, and requires that this string match a Subject Alternative Name (SAN) in the backend's + server certificate. With a Regional Internet NEG backend, if the SNI is specified here, the load balancer uses it + regardless of whether the Regional Internet NEG is specified with FQDN or IP address and port. + """ + subjectAltNames: Optional[List[SubjectAltName]] = None + """ + A list of Subject Alternative Names (SANs) that the Load Balancer verifies during a TLS handshake with the backend. + When the server presents its X.509 certificate to the Load Balancer, the Load Balancer inspects the certificate's SAN field, + and requires that at least one SAN match one of the subjectAltNames in the list. This field is limited to 5 entries. + When both sni and subjectAltNames are specified, the load balancer matches the backend certificate's SAN only to + subjectAltNames. + Structure is documented below. + """ + + +class ForProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[List[CircuitBreaker]] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[List[ConsistentHashItem]] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + customMetrics: Optional[List[CustomMetricModel]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HealthCheck in compute to populate healthChecks. + """ + iap: Optional[List[IapItem]] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[List[OutlierDetectionItem]] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[List[SecuritySetting]] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[List[StrongSessionAffinityCookieItem]] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[List[TlsSetting]] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class CustomMetricModel1(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class CustomMetricModel2(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class InitProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[List[CircuitBreaker]] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[List[ConsistentHashItem]] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + customMetrics: Optional[List[CustomMetricModel2]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HealthCheck in compute to populate healthChecks. + """ + iap: Optional[List[IapItem]] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[List[OutlierDetectionItem]] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[List[SecuritySetting]] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[List[StrongSessionAffinityCookieItem]] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[List[TlsSetting]] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CustomMetricModel3(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class BackendItemModel(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + For global HTTP(S) or TCP/SSL load balancing, the default is + UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)), + CUSTOM_METRICS (for HTTP(s)) and CONNECTION (for TCP/SSL). + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + Default value is 1, which means the group will serve up to 100% + of its configured capacity (depending on balancingMode). A + setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetricModel3]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either + maxConnections or maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. For RATE mode, either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + """ + preference: Optional[str] = None + """ + This field indicates whether this backend should be fully utilized before sending traffic to backends + with default preference. This field cannot be set when loadBalancingScheme is set to 'EXTERNAL'. The possible values are: + """ + + +class CustomMetricModel4(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class IapItemModel(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + + +class AwsV4AuthenticationItemModel(BaseModel): + accessKeyId: Optional[str] = None + """ + The identifier of an access key used for s3 bucket authentication. + """ + accessKeyVersion: Optional[str] = None + """ + The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + """ + originRegion: Optional[str] = None + """ + The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. + For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + """ + + +class AtProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItemModel]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[List[CircuitBreaker]] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[List[ConsistentHashItem]] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customMetrics: Optional[List[CustomMetricModel4]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + generatedId: Optional[float] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + iap: Optional[List[IapItemModel]] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendServices/{{name}} + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[List[OutlierDetectionItem]] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[List[SecuritySetting]] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[List[StrongSessionAffinityCookieItem]] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[List[TlsSetting]] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendService(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendService']] = 'BackendService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendServiceSpec defines the desired state of BackendService + """ + status: Optional[Status] = None + """ + BackendServiceStatus defines the observed state of BackendService. + """ + + +class BackendServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendService] + """ + List of backendservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta2.py new file mode 100644 index 000000000..45985a198 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/backendservice/v1beta2.py @@ -0,0 +1,1913 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_backendservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CustomMetric(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BackendItem(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + For global HTTP(S) or TCP/SSL load balancing, the default is + UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)), + CUSTOM_METRICS (for HTTP(s)) and CONNECTION (for TCP/SSL). + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + Default value is 1, which means the group will serve up to 100% + of its configured capacity (depending on balancingMode). A + setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetric]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + groupRef: Optional[GroupRef] = None + """ + Reference to a InstanceGroupManager in compute to populate group. + """ + groupSelector: Optional[GroupSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate group. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either + maxConnections or maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. For RATE mode, either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + """ + preference: Optional[str] = None + """ + This field indicates whether this backend should be fully utilized before sending traffic to backends + with default preference. This field cannot be set when loadBalancingScheme is set to 'EXTERNAL'. The possible values are: + """ + + +class BypassCacheOnRequestHeader(BaseModel): + headerName: Optional[str] = None + """ + The header field name to match on when bypassing cache. Values are case-insensitive. + """ + + +class CacheKeyPolicy(BaseModel): + includeHost: Optional[bool] = None + """ + If true requests to different hosts will be cached separately. + """ + includeHttpHeaders: Optional[List[str]] = None + """ + Allows HTTP request headers (by name) to be used in the + cache key. + """ + includeNamedCookies: Optional[List[str]] = None + """ + Names of cookies to include in cache keys. + """ + includeProtocol: Optional[bool] = None + """ + If true, http and https requests will be cached separately. + """ + includeQueryString: Optional[bool] = None + """ + If true, include query string parameters in the cache key + according to query_string_whitelist and + query_string_blacklist. If neither is set, the entire query + string will be included. + If false, the query string will be excluded from the cache + key entirely. + """ + queryStringBlacklist: Optional[List[str]] = None + """ + Names of query string parameters to exclude in cache keys. + All other parameters will be included. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + All other parameters will be excluded. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + ttl: Optional[float] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class CdnPolicy(BaseModel): + bypassCacheOnRequestHeaders: Optional[List[BypassCacheOnRequestHeader]] = None + """ + Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. + The cache is bypassed for all cdnPolicy.cacheMode settings. + Structure is documented below. + """ + cacheKeyPolicy: Optional[CacheKeyPolicy] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + requestCoalescing: Optional[bool] = None + """ + If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests + to the origin. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request + will be considered fresh, defaults to 1hr (3600s). After this + time period, the response will be revalidated before + being served. + When serving responses to signed URL requests, Cloud CDN will + internally behave as though all responses from this backend had a + "Cache-Control: public, max-age=[TTL]" header, regardless of any + existing Cache-Control header. The actual headers served in + responses will not be altered. + """ + + +class CircuitBreakers(BaseModel): + maxConnections: Optional[float] = None + """ + The maximum number of connections to the backend cluster. + Defaults to 1024. + """ + maxPendingRequests: Optional[float] = None + """ + The maximum number of pending requests to the backend cluster. + Defaults to 1024. + """ + maxRequests: Optional[float] = None + """ + The maximum number of parallel requests to the backend cluster. + Defaults to 1024. + """ + maxRequestsPerConnection: Optional[float] = None + """ + Maximum requests for a single backend connection. This parameter + is respected by both the HTTP/1.1 and HTTP/2 implementations. If + not specified, there is no limit. Setting this parameter to 1 + will effectively disable keep alive. + """ + maxRetries: Optional[float] = None + """ + The maximum number of parallel retries to the backend cluster. + Defaults to 3. + """ + + +class Ttl(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class HttpCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ConsistentHash(BaseModel): + httpCookie: Optional[HttpCookie] = None + """ + Hash is based on HTTP Cookie. This field describes a HTTP cookie + that will be used as the hash key for the consistent hash load + balancer. If the cookie is not present, it will be generated. + This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + Structure is documented below. + """ + httpHeaderName: Optional[str] = None + """ + The hash based on the value of the specified header field. + This field is applicable if the sessionAffinity is set to HEADER_FIELD. + """ + minimumRingSize: Optional[float] = None + """ + The minimum number of virtual nodes to use for the hash ring. + Larger ring sizes result in more granular load + distributions. If the number of hosts in the load balancing pool + is larger than the ring size, each host will be assigned a single + virtual node. + Defaults to 1024. + """ + + +class CustomMetricModel(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Oauth2ClientSecretSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Iap(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + oauth2ClientSecretSecretRef: Optional[Oauth2ClientSecretSecretRef] = None + """ + OAuth2 Client Secret for IAP + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class CustomPolicy(BaseModel): + data: Optional[str] = None + """ + An optional, arbitrary JSON object with configuration data, understood + by a locally installed custom policy implementation. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class PolicyModel(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class LocalityLbPolicy(BaseModel): + customPolicy: Optional[CustomPolicy] = None + """ + The configuration for a custom policy implemented by the user and + deployed with the client. + Structure is documented below. + """ + policy: Optional[PolicyModel] = None + """ + The configuration for a built-in load balancing policy. + Structure is documented below. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Whether to enable logging for the load balancer traffic served by this backend service. + """ + optionalFields: Optional[List[str]] = None + """ + This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" + was set to CUSTOM. Contains a list of optional fields you want to include in the logs. + For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace + For example: orca_load_report, tls.protocol + """ + optionalMode: Optional[str] = None + """ + Specifies the optional logging mode for the load balancer traffic. + Supported values: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + Possible values are: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + """ + sampleRate: Optional[float] = None + """ + This field can only be specified if logging is enabled for this backend service. The value of + the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer + where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. + The default value is 1.0. + """ + + +class MaxStreamDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. + Durations less than one second are represented with a 0 seconds field and a positive nanos field. + Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. (int64 format) + """ + + +class BaseEjectionTime(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class Interval(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class OutlierDetection(BaseModel): + baseEjectionTime: Optional[BaseEjectionTime] = None + """ + The base time that a host is ejected for. The real time is equal to the base + time multiplied by the number of times the host has been ejected. Defaults to + 30000ms or 30s. + Structure is documented below. + """ + consecutiveErrors: Optional[float] = None + """ + Number of errors before a host is ejected from the connection pool. When the + backend host is accessed over HTTP, a 5xx return code qualifies as an error. + Defaults to 5. + """ + consecutiveGatewayFailure: Optional[float] = None + """ + The number of consecutive gateway failures (502, 503, 504 status or connection + errors that are mapped to one of those status codes) before a consecutive + gateway failure ejection occurs. Defaults to 5. + """ + enforcingConsecutiveErrors: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive 5xx. This setting can be used to disable + ejection or to ramp it up slowly. Defaults to 100. + """ + enforcingConsecutiveGatewayFailure: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive gateway failures. This setting can be + used to disable ejection or to ramp it up slowly. Defaults to 0. + """ + enforcingSuccessRate: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through success rate statistics. This setting can be used to + disable ejection or to ramp it up slowly. Defaults to 100. + """ + interval: Optional[Interval] = None + """ + Time interval between ejection sweep analysis. This can result in both new + ejections as well as hosts being returned to service. Defaults to 10 seconds. + Structure is documented below. + """ + maxEjectionPercent: Optional[float] = None + """ + Maximum percentage of hosts in the load balancing pool for the backend service + that can be ejected. Defaults to 10%. + """ + successRateMinimumHosts: Optional[float] = None + """ + The number of hosts in a cluster that must have enough request volume to detect + success rate outliers. If the number of hosts is less than this setting, outlier + detection via success rate statistics is not performed for any host in the + cluster. Defaults to 5. + """ + successRateRequestVolume: Optional[float] = None + """ + The minimum number of total requests that must be collected in one interval (as + defined by the interval duration above) to include this host in success rate + based outlier detection. If the volume is lower than this setting, outlier + detection via success rate statistics is not performed for that host. Defaults + to 100. + """ + successRateStdevFactor: Optional[float] = None + """ + This factor is used to determine the ejection threshold for success rate outlier + ejection. The ejection threshold is the difference between the mean success + rate, and the product of this factor and the standard deviation of the mean + success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided + by a thousand to get a double. That is, if the desired factor is 1.9, the + runtime value should be 1900. Defaults to 1900. + """ + + +class AccessKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class AwsV4Authentication(BaseModel): + accessKeyId: Optional[str] = None + """ + The identifier of an access key used for s3 bucket authentication. + """ + accessKeySecretRef: Optional[AccessKeySecretRef] = None + """ + The access key used for s3 bucket authentication. + Required for updating or creating a backend that uses AWS v4 signature authentication, but will not be returned as part of the configuration when queried with a REST API GET request. + Note: This property is sensitive and will not be displayed in the plan. + """ + accessKeyVersion: Optional[str] = None + """ + The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + """ + originRegion: Optional[str] = None + """ + The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. + For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + """ + + +class SecuritySettings(BaseModel): + awsV4Authentication: Optional[AwsV4Authentication] = None + """ + The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. + Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends. + Structure is documented below. + """ + clientTlsPolicy: Optional[str] = None + """ + ClientTlsPolicy is a resource that specifies how a client should authenticate + connections to backends of a service. This resource itself does not affect + configuration unless it is attached to a backend service resource. + """ + subjectAltNames: Optional[List[str]] = None + """ + A list of alternate names to verify the subject identity in the certificate. + If specified, the client will verify that the server certificate's subject + alt name matches one of the specified values. + """ + + +class StrongSessionAffinityCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class SubjectAltName(BaseModel): + dnsName: Optional[str] = None + """ + The SAN specified as a DNS Name. + """ + uniformResourceIdentifier: Optional[str] = None + """ + The SAN specified as a URI. + """ + + +class TlsSettings(BaseModel): + authenticationConfig: Optional[str] = None + """ + Reference to the BackendAuthenticationConfig resource from the networksecurity.googleapis.com namespace. + Can be used in authenticating TLS connections to the backend, as specified by the authenticationMode field. + Can only be specified if authenticationMode is not NONE. + """ + sni: Optional[str] = None + """ + Server Name Indication - see RFC3546 section 3.1. If set, the load balancer sends this string as the SNI hostname in the + TLS connection to the backend, and requires that this string match a Subject Alternative Name (SAN) in the backend's + server certificate. With a Regional Internet NEG backend, if the SNI is specified here, the load balancer uses it + regardless of whether the Regional Internet NEG is specified with FQDN or IP address and port. + """ + subjectAltNames: Optional[List[SubjectAltName]] = None + """ + A list of Subject Alternative Names (SANs) that the Load Balancer verifies during a TLS handshake with the backend. + When the server presents its X.509 certificate to the Load Balancer, the Load Balancer inspects the certificate's SAN field, + and requires that at least one SAN match one of the subjectAltNames in the list. This field is limited to 5 entries. + When both sni and subjectAltNames are specified, the load balancer matches the backend certificate's SAN only to + subjectAltNames. + Structure is documented below. + """ + + +class ForProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + customMetrics: Optional[List[CustomMetricModel]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[SecuritySettings] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[TlsSettings] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class CustomMetricModel1(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class PolicyModel1(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class CustomMetricModel2(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class PolicyModel2(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class InitProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + customMetrics: Optional[List[CustomMetricModel2]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[SecuritySettings] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[TlsSettings] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class PolicyModel3(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[PolicyModel3] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CustomMetricModel3(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class BackendItemModel(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + For global HTTP(S) or TCP/SSL load balancing, the default is + UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)), + CUSTOM_METRICS (for HTTP(s)) and CONNECTION (for TCP/SSL). + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + Default value is 1, which means the group will serve up to 100% + of its configured capacity (depending on balancingMode). A + setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetricModel3]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either + maxConnections or maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. For RATE mode, either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + """ + preference: Optional[str] = None + """ + This field indicates whether this backend should be fully utilized before sending traffic to backends + with default preference. This field cannot be set when loadBalancingScheme is set to 'EXTERNAL'. The possible values are: + """ + + +class CustomMetricModel4(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class IapModel(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + + +class PolicyModel4(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class AwsV4AuthenticationModel(BaseModel): + accessKeyId: Optional[str] = None + """ + The identifier of an access key used for s3 bucket authentication. + """ + accessKeyVersion: Optional[str] = None + """ + The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + """ + originRegion: Optional[str] = None + """ + The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. + For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + """ + + +class AtProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItemModel]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customMetrics: Optional[List[CustomMetricModel4]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + generatedId: Optional[float] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + iap: Optional[IapModel] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendServices/{{name}} + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[SecuritySettings] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[TlsSettings] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendService(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['BackendService']] = 'BackendService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendServiceSpec defines the desired state of BackendService + """ + status: Optional[Status] = None + """ + BackendServiceStatus defines the observed state of BackendService. + """ + + +class BackendServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendService] + """ + List of backendservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/backendservicesignedurlkey/__init__.py b/schemas/python/models/io/upbound/gcp/compute/backendservicesignedurlkey/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/backendservicesignedurlkey/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/backendservicesignedurlkey/v1beta1.py new file mode 100644 index 000000000..5dd10efea --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/backendservicesignedurlkey/v1beta1.py @@ -0,0 +1,319 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_backendservicesignedurlkey.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class KeyValueSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + The backend service this signed URL key belongs. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + keyValueSecretRef: Optional[KeyValueSecretRef] = None + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + The backend service this signed URL key belongs. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + keyValueSecretRef: KeyValueSecretRef + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + The backend service this signed URL key belongs. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendServices/{{backend_service}} + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendServiceSignedURLKey(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendServiceSignedURLKey']] = 'BackendServiceSignedURLKey' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendServiceSignedURLKeySpec defines the desired state of BackendServiceSignedURLKey + """ + status: Optional[Status] = None + """ + BackendServiceSignedURLKeyStatus defines the observed state of BackendServiceSignedURLKey. + """ + + +class BackendServiceSignedURLKeyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendServiceSignedURLKey] + """ + List of backendservicesignedurlkeys. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/disk/__init__.py b/schemas/python/models/io/upbound/gcp/compute/disk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/disk/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/disk/v1beta1.py new file mode 100644 index 000000000..2b69cba43 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/disk/v1beta1.py @@ -0,0 +1,1022 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_disk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AsyncPrimaryDiskItem(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE. + """ + + +class Param(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the disk. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. + """ + + +class SourceImageEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class SourceSnapshotEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class ForProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[List[AsyncPrimaryDiskItem]] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItem]] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + zone: str + """ + A reference to the zone where the disk resides. + """ + + +class InitProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[List[AsyncPrimaryDiskItem]] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItem]] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsyncPrimaryDiskItemModel(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + + +class DiskEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceImageEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class AtProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[List[AsyncPrimaryDiskItemModel]] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItemModel]] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + diskId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/disks/{{name}} + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + lastAttachTimestamp: Optional[str] = None + """ + Last attach timestamp in RFC3339 text format. + """ + lastDetachTimestamp: Optional[str] = None + """ + Last detach timestamp in RFC3339 text format. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceDiskId: Optional[str] = None + """ + The ID value of the disk used to create this image. This value may + be used to determine whether the image was taken from the current + or a previous instance of a given disk name. + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItemModel]] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceImageId: Optional[str] = None + """ + The ID value of the image used to create this disk. This value + identifies the exact image that was used to create this persistent + disk. For example, if you created the persistent disk from an image + that was later deleted and recreated under the same name, the source + image ID would identify the exact version of the image that was used. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceInstantSnapshotId: Optional[str] = None + """ + The unique ID of the instant snapshot used to create this disk. This value identifies + the exact instant snapshot that was used to create this persistent disk. + For example, if you created the persistent disk from an instant snapshot that was later + deleted and recreated under the same name, the source instant snapshot ID would identify + the exact version of the instant snapshot that was used. + """ + sourceSnapshotEncryptionKey: Optional[ + List[SourceSnapshotEncryptionKeyItemModel] + ] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceSnapshotId: Optional[str] = None + """ + The unique ID of the snapshot used to create this disk. This value + identifies the exact snapshot that was used to create this persistent + disk. For example, if you created the persistent disk from a snapshot + that was later deleted and recreated under the same name, the source + snapshot ID would identify the exact version of the snapshot that was + used. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + users: Optional[List[str]] = None + """ + Links to the users of the disk (attached instances) in form: + project/zones/zone/instances/instance + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Disk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Disk']] = 'Disk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskSpec defines the desired state of Disk + """ + status: Optional[Status] = None + """ + DiskStatus defines the observed state of Disk. + """ + + +class DiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Disk] + """ + List of disks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/disk/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/disk/v1beta2.py new file mode 100644 index 000000000..a9923c175 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/disk/v1beta2.py @@ -0,0 +1,1019 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_disk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AsyncPrimaryDisk(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the disk. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class ForProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + zone: str + """ + A reference to the zone where the disk resides. + """ + + +class InitProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsyncPrimaryDiskModel(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + + +class DiskEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class AtProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDiskModel] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKeyModel] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + diskId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/disks/{{name}} + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + lastAttachTimestamp: Optional[str] = None + """ + Last attach timestamp in RFC3339 text format. + """ + lastDetachTimestamp: Optional[str] = None + """ + Last detach timestamp in RFC3339 text format. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceDiskId: Optional[str] = None + """ + The ID value of the disk used to create this image. This value may + be used to determine whether the image was taken from the current + or a previous instance of a given disk name. + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceImageId: Optional[str] = None + """ + The ID value of the image used to create this disk. This value + identifies the exact image that was used to create this persistent + disk. For example, if you created the persistent disk from an image + that was later deleted and recreated under the same name, the source + image ID would identify the exact version of the image that was used. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceInstantSnapshotId: Optional[str] = None + """ + The unique ID of the instant snapshot used to create this disk. This value identifies + the exact instant snapshot that was used to create this persistent disk. + For example, if you created the persistent disk from an instant snapshot that was later + deleted and recreated under the same name, the source instant snapshot ID would identify + the exact version of the instant snapshot that was used. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceSnapshotId: Optional[str] = None + """ + The unique ID of the snapshot used to create this disk. This value + identifies the exact snapshot that was used to create this persistent + disk. For example, if you created the persistent disk from a snapshot + that was later deleted and recreated under the same name, the source + snapshot ID would identify the exact version of the snapshot that was + used. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + users: Optional[List[str]] = None + """ + Links to the users of the disk (attached instances) in form: + project/zones/zone/instances/instance + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Disk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Disk']] = 'Disk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskSpec defines the desired state of Disk + """ + status: Optional[Status] = None + """ + DiskStatus defines the observed state of Disk. + """ + + +class DiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Disk] + """ + List of disks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/diskiammember/__init__.py b/schemas/python/models/io/upbound/gcp/compute/diskiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta1.py new file mode 100644 index 000000000..ff192f6e9 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta1.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_diskiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a Disk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Disk in compute to populate name. + """ + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a Disk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Disk in compute to populate name. + """ + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class DiskIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['DiskIAMMember']] = 'DiskIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskIAMMemberSpec defines the desired state of DiskIAMMember + """ + status: Optional[Status] = None + """ + DiskIAMMemberStatus defines the observed state of DiskIAMMember. + """ + + +class DiskIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[DiskIAMMember] + """ + List of diskiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta2.py new file mode 100644 index 000000000..89097cb64 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/diskiammember/v1beta2.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_diskiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a Disk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Disk in compute to populate name. + """ + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a Disk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Disk in compute to populate name. + """ + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class DiskIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['DiskIAMMember']] = 'DiskIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskIAMMemberSpec defines the desired state of DiskIAMMember + """ + status: Optional[Status] = None + """ + DiskIAMMemberStatus defines the observed state of DiskIAMMember. + """ + + +class DiskIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[DiskIAMMember] + """ + List of diskiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/diskresourcepolicyattachment/__init__.py b/schemas/python/models/io/upbound/gcp/compute/diskresourcepolicyattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/diskresourcepolicyattachment/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/diskresourcepolicyattachment/v1beta1.py new file mode 100644 index 000000000..599ef5e40 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/diskresourcepolicyattachment/v1beta1.py @@ -0,0 +1,352 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_diskresourcepolicyattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class InitProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the disk in which the resource policies are attached to. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{zone}}/{{disk}}/{{name}} + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class DiskResourcePolicyAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['DiskResourcePolicyAttachment']] = ( + 'DiskResourcePolicyAttachment' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskResourcePolicyAttachmentSpec defines the desired state of DiskResourcePolicyAttachment + """ + status: Optional[Status] = None + """ + DiskResourcePolicyAttachmentStatus defines the observed state of DiskResourcePolicyAttachment. + """ + + +class DiskResourcePolicyAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[DiskResourcePolicyAttachment] + """ + List of diskresourcepolicyattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/externalvpngateway/__init__.py b/schemas/python/models/io/upbound/gcp/compute/externalvpngateway/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/externalvpngateway/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/externalvpngateway/v1beta1.py new file mode 100644 index 000000000..04a3b3587 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/externalvpngateway/v1beta1.py @@ -0,0 +1,324 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_externalvpngateway.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class InterfaceItem(BaseModel): + id: Optional[float] = None + """ + The numeric ID for this interface. Allowed values are based on the redundancy type + of this external VPN gateway + """ + ipAddress: Optional[str] = None + """ + IP address of the interface in the external VPN gateway. + Only IPv4 is supported. This IP address can be either from + your on-premise gateway or another Cloud provider's VPN gateway, + it cannot be an IP address from Google Compute Engine. + """ + ipv6Address: Optional[str] = None + """ + IPv6 address of the interface in the external VPN gateway. This IPv6 + address can be either from your on-premise gateway or another Cloud + provider's VPN gateway, it cannot be an IP address from Google Compute + Engine. Must specify an IPv6 address (not IPV4-mapped) using any format + described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format + is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + interface: Optional[List[InterfaceItem]] = None + """ + A list of interfaces on this external VPN gateway. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for the external VPN gateway resource. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + redundancyType: Optional[str] = None + """ + Indicates the redundancy type of this external VPN gateway + Possible values are: FOUR_IPS_REDUNDANCY, SINGLE_IP_INTERNALLY_REDUNDANT, TWO_IPS_REDUNDANCY. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + interface: Optional[List[InterfaceItem]] = None + """ + A list of interfaces on this external VPN gateway. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for the external VPN gateway resource. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + redundancyType: Optional[str] = None + """ + Indicates the redundancy type of this external VPN gateway + Possible values are: FOUR_IPS_REDUNDANCY, SINGLE_IP_INTERNALLY_REDUNDANT, TWO_IPS_REDUNDANCY. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/externalVpnGateways/{{name}} + """ + interface: Optional[List[InterfaceItem]] = None + """ + A list of interfaces on this external VPN gateway. + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for the external VPN gateway resource. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + redundancyType: Optional[str] = None + """ + Indicates the redundancy type of this external VPN gateway + Possible values are: FOUR_IPS_REDUNDANCY, SINGLE_IP_INTERNALLY_REDUNDANT, TWO_IPS_REDUNDANCY. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ExternalVPNGateway(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ExternalVPNGateway']] = 'ExternalVPNGateway' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ExternalVPNGatewaySpec defines the desired state of ExternalVPNGateway + """ + status: Optional[Status] = None + """ + ExternalVPNGatewayStatus defines the observed state of ExternalVPNGateway. + """ + + +class ExternalVPNGatewayList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ExternalVPNGateway] + """ + List of externalvpngateways. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/firewall/__init__.py b/schemas/python/models/io/upbound/gcp/compute/firewall/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/firewall/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/firewall/v1beta1.py new file mode 100644 index 000000000..19db81902 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/firewall/v1beta1.py @@ -0,0 +1,703 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_firewall.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AllowItem(BaseModel): + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field + is only applicable for UDP or TCP protocol. Each entry must be + either an integer or a range. If not specified, this rule + applies to connections through any port. + Example inputs include: ["22"], ["80","443"], and + ["12345-12349"]. + """ + protocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is + required when creating a firewall rule. This value can either be + one of the following well known protocol strings (tcp, udp, + icmp, esp, ah, sctp, ipip, all), or the IP protocol number. + """ + + +class DenyItem(BaseModel): + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field + is only applicable for UDP or TCP protocol. Each entry must be + either an integer or a range. If not specified, this rule + applies to connections through any port. + Example inputs include: ["22"], ["80","443"], and + ["12345-12349"]. + """ + protocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is + required when creating a firewall rule. This value can either be + one of the following well known protocol strings (tcp, udp, + icmp, esp, ah, sctp, ipip, all), or the IP protocol number. + """ + + +class LogConfigItem(BaseModel): + metadata: Optional[str] = None + """ + This field denotes whether to include or exclude metadata for firewall logs. + Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Param(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the firewall. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class ForProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class InitProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewalls/{{name}} + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Firewall(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Firewall']] = 'Firewall' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallSpec defines the desired state of Firewall + """ + status: Optional[Status] = None + """ + FirewallStatus defines the observed state of Firewall. + """ + + +class FirewallList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Firewall] + """ + List of firewalls. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/firewall/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/firewall/v1beta2.py new file mode 100644 index 000000000..b13614911 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/firewall/v1beta2.py @@ -0,0 +1,703 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_firewall.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AllowItem(BaseModel): + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field + is only applicable for UDP or TCP protocol. Each entry must be + either an integer or a range. If not specified, this rule + applies to connections through any port. + Example inputs include: [22], [80, 443], and + ["12345-12349"]. + """ + protocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is + required when creating a firewall rule. This value can either be + one of the following well known protocol strings (tcp, udp, + icmp, esp, ah, sctp, ipip, all), or the IP protocol number. + """ + + +class DenyItem(BaseModel): + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field + is only applicable for UDP or TCP protocol. Each entry must be + either an integer or a range. If not specified, this rule + applies to connections through any port. + Example inputs include: [22], [80, 443], and + ["12345-12349"]. + """ + protocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is + required when creating a firewall rule. This value can either be + one of the following well known protocol strings (tcp, udp, + icmp, esp, ah, sctp, ipip, all), or the IP protocol number. + """ + + +class LogConfig(BaseModel): + metadata: Optional[str] = None + """ + This field denotes whether to include or exclude metadata for firewall logs. + Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the firewall. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class ForProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class InitProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewalls/{{name}} + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Firewall(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Firewall']] = 'Firewall' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallSpec defines the desired state of Firewall + """ + status: Optional[Status] = None + """ + FirewallStatus defines the observed state of Firewall. + """ + + +class FirewallList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Firewall] + """ + List of firewalls. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/firewallpolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/firewallpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/firewallpolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/firewallpolicy/v1beta1.py new file mode 100644 index 000000000..da080cf54 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/firewallpolicy/v1beta1.py @@ -0,0 +1,280 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_firewallpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + parent: Optional[str] = None + """ + The parent of the firewall policy. + """ + shortName: Optional[str] = None + """ + User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. + This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. The name must be 1-63 characters long, and comply with RFC1035. + Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + parent: Optional[str] = None + """ + The parent of the firewall policy. + """ + shortName: Optional[str] = None + """ + User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. + This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. The name must be 1-63 characters long, and comply with RFC1035. + Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of the resource. This field is used internally during updates of this resource. + """ + firewallPolicyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format locations/global/firewallPolicies/{{name}} + """ + name: Optional[str] = None + """ + Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy. + """ + parent: Optional[str] = None + """ + The parent of the firewall policy. + """ + ruleTupleCount: Optional[float] = None + """ + Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + shortName: Optional[str] = None + """ + User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. + This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. The name must be 1-63 characters long, and comply with RFC1035. + Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FirewallPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['FirewallPolicy']] = 'FirewallPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallPolicySpec defines the desired state of FirewallPolicy + """ + status: Optional[Status] = None + """ + FirewallPolicyStatus defines the observed state of FirewallPolicy. + """ + + +class FirewallPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FirewallPolicy] + """ + List of firewallpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/firewallpolicyassociation/__init__.py b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyassociation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/firewallpolicyassociation/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyassociation/v1beta1.py new file mode 100644 index 000000000..8459b6830 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyassociation/v1beta1.py @@ -0,0 +1,348 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_firewallpolicyassociation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class AttachmentTargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class AttachmentTargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Folder in cloudplatform to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Folder in cloudplatform to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + This field can be updated to refer to a different Firewall Policy, which will create a new association from that new + firewall policy with the flag to override the existing attachmentTarget's policy association. + Note Due to potential risks with this operation it is highly recommended to use the create_before_destroy life cycle option + on your exisiting firewall policy so as to prevent a situation where your attachment target has no associated policy. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + name: Optional[str] = None + """ + The name for an association. + """ + + +class InitProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Folder in cloudplatform to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Folder in cloudplatform to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + This field can be updated to refer to a different Firewall Policy, which will create a new association from that new + firewall policy with the flag to override the existing attachmentTarget's policy association. + Note Due to potential risks with this operation it is highly recommended to use the create_before_destroy life cycle option + on your exisiting firewall policy so as to prevent a situation where your attachment target has no associated policy. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + name: Optional[str] = None + """ + The name for an association. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + This field can be updated to refer to a different Firewall Policy, which will create a new association from that new + firewall policy with the flag to override the existing attachmentTarget's policy association. + Note Due to potential risks with this operation it is highly recommended to use the create_before_destroy life cycle option + on your exisiting firewall policy so as to prevent a situation where your attachment target has no associated policy. + """ + id: Optional[str] = None + """ + an identifier for the resource with format locations/global/firewallPolicies/{{firewall_policy}}/associations/{{name}} + """ + name: Optional[str] = None + """ + The name for an association. + """ + shortName: Optional[str] = None + """ + The short name of the firewall policy of the association. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FirewallPolicyAssociation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['FirewallPolicyAssociation']] = 'FirewallPolicyAssociation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallPolicyAssociationSpec defines the desired state of FirewallPolicyAssociation + """ + status: Optional[Status] = None + """ + FirewallPolicyAssociationStatus defines the observed state of FirewallPolicyAssociation. + """ + + +class FirewallPolicyAssociationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FirewallPolicyAssociation] + """ + List of firewallpolicyassociations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/__init__.py b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta1.py new file mode 100644 index 000000000..bcf848274 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta1.py @@ -0,0 +1,570 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_firewallpolicyrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Layer4Config(BaseModel): + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + """ + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SrcSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class MatchItem(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. Destination address groups is only supported in Egress rules. + """ + destFqdns: Optional[List[str]] = None + """ + Domain names that will be used to match against the resolved domain name of destination of traffic. Can only be specified if DIRECTION is egress. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256. + """ + destRegionCodes: Optional[List[str]] = None + """ + The Unicode country codes whose IP addresses will be used to match against the source of traffic. Can only be specified if DIRECTION is egress. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Name of the Google Cloud Threat Intelligence list. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. Source address groups is only supported in Ingress rules. + """ + srcFqdns: Optional[List[str]] = None + """ + Domain names that will be used to match against the resolved domain name of source of traffic. Can only be specified if DIRECTION is ingress. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256. + """ + srcRegionCodes: Optional[List[str]] = None + """ + The Unicode country codes whose IP addresses will be used to match against the source of traffic. Can only be specified if DIRECTION is ingress. + """ + srcSecureTags: Optional[List[SrcSecureTag]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Name of the Google Cloud Threat Intelligence list. + """ + + +class TargetSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class ForProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "goto_next". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. Possible values: INGRESS, EGRESS + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[List[MatchItem]] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfileGroup resource. Example: https://networksecurity.googleapis.com/v1/organizations/{organizationId}/locations/global/securityProfileGroups/my-security-profile-group. It must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. It can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class InitProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "goto_next". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. Possible values: INGRESS, EGRESS + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[List[MatchItem]] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfileGroup resource. Example: https://networksecurity.googleapis.com/v1/organizations/{organizationId}/locations/global/securityProfileGroups/my-security-profile-group. It must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. It can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SrcSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class TargetSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class AtProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "goto_next". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. Possible values: INGRESS, EGRESS + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}} + """ + kind: Optional[str] = None + """ + Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + """ + match: Optional[List[MatchItem]] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + ruleTupleCount: Optional[float] = None + """ + Calculation of the complexity of a single firewall policy rule. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfileGroup resource. Example: https://networksecurity.googleapis.com/v1/organizations/{organizationId}/locations/global/securityProfileGroups/my-security-profile-group. It must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTagModel]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. It can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FirewallPolicyRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['FirewallPolicyRule']] = 'FirewallPolicyRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallPolicyRuleSpec defines the desired state of FirewallPolicyRule + """ + status: Optional[Status] = None + """ + FirewallPolicyRuleStatus defines the observed state of FirewallPolicyRule. + """ + + +class FirewallPolicyRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FirewallPolicyRule] + """ + List of firewallpolicyrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta2.py new file mode 100644 index 000000000..474b5be45 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/firewallpolicyrule/v1beta2.py @@ -0,0 +1,706 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_firewallpolicyrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DestAddressGroupsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DestAddressGroupsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Layer4Config(BaseModel): + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. + This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + """ + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SrcSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class Match(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destAddressGroupsRefs: Optional[List[DestAddressGroupsRef]] = None + """ + References to AddressGroup in networksecurity to populate destAddressGroups. + """ + destAddressGroupsSelector: Optional[DestAddressGroupsSelector] = None + """ + Selector for a list of AddressGroup in networksecurity to populate destAddressGroups. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTag]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class ForProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. + This field allows you to control which network's VMs get this rule. + If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class InitProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. + This field allows you to control which network's VMs get this rule. + If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SrcSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class MatchModel(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTagModel]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class AtProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}} + """ + kind: Optional[str] = None + """ + Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + """ + match: Optional[MatchModel] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + ruleTupleCount: Optional[float] = None + """ + Calculation of the complexity of a single firewall policy rule. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. + This field allows you to control which network's VMs get this rule. + If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTagModel]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FirewallPolicyRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['FirewallPolicyRule']] = 'FirewallPolicyRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallPolicyRuleSpec defines the desired state of FirewallPolicyRule + """ + status: Optional[Status] = None + """ + FirewallPolicyRuleStatus defines the observed state of FirewallPolicyRule. + """ + + +class FirewallPolicyRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FirewallPolicyRule] + """ + List of firewallpolicyrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/forwardingrule/__init__.py b/schemas/python/models/io/upbound/gcp/compute/forwardingrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta1.py new file mode 100644 index 000000000..602393948 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta1.py @@ -0,0 +1,1029 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_forwardingrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class IpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceDirectoryRegistration(BaseModel): + namespace: Optional[str] = None + """ + Service Directory namespace to register the forwarding rule under. + """ + service: Optional[str] = None + """ + Service Directory service to register the forwarding rule under. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a Address in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a Address in compute to populate ipAddress. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + region: str + """ + A reference to the region where the regional forwarding rule resides. + This field is not applicable to global forwarding rules. + """ + serviceDirectoryRegistrations: Optional[List[ServiceDirectoryRegistration]] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionTargetHTTPProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionTargetHTTPProxy in compute to populate target. + """ + + +class InitProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a Address in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a Address in compute to populate ipAddress. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + serviceDirectoryRegistrations: Optional[List[ServiceDirectoryRegistration]] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionTargetHTTPProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionTargetHTTPProxy in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + baseForwardingRule: Optional[str] = None + """ + [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + forwardingRuleId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/forwardingRules/{{name}} + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscConnectionId: Optional[str] = None + """ + The PSC connection id of the PSC Forwarding Rule. + """ + pscConnectionStatus: Optional[str] = None + """ + The PSC connection status of the PSC Forwarding Rule. Possible values: STATUS_UNSPECIFIED, PENDING, ACCEPTED, REJECTED, CLOSED + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + region: Optional[str] = None + """ + A reference to the region where the regional forwarding rule resides. + This field is not applicable to global forwarding rules. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceDirectoryRegistrations: Optional[List[ServiceDirectoryRegistration]] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + serviceName: Optional[str] = None + """ + The internal fully qualified service name for this Forwarding Rule. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ForwardingRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ForwardingRule']] = 'ForwardingRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ForwardingRuleSpec defines the desired state of ForwardingRule + """ + status: Optional[Status] = None + """ + ForwardingRuleStatus defines the observed state of ForwardingRule. + """ + + +class ForwardingRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ForwardingRule] + """ + List of forwardingrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta2.py new file mode 100644 index 000000000..faa32f7e5 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/forwardingrule/v1beta2.py @@ -0,0 +1,1038 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_forwardingrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class IpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceDirectoryRegistrations(BaseModel): + namespace: Optional[str] = None + """ + Service Directory namespace to register the forwarding rule under. + """ + service: Optional[str] = None + """ + Service Directory service to register the forwarding rule under. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a Address in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a Address in compute to populate ipAddress. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + Note that an empty string value ("") is also supported for some use + cases, for example PSC (private service connection) regional forwarding + rules. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + region: str + """ + A reference to the region where the regional forwarding rule resides. + This field is not applicable to global forwarding rules. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionTargetHTTPProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionTargetHTTPProxy in compute to populate target. + """ + + +class InitProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a Address in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a Address in compute to populate ipAddress. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + Note that an empty string value ("") is also supported for some use + cases, for example PSC (private service connection) regional forwarding + rules. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionTargetHTTPProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionTargetHTTPProxy in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + baseForwardingRule: Optional[str] = None + """ + [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + forwardingRuleId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/forwardingRules/{{name}} + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + Note that an empty string value ("") is also supported for some use + cases, for example PSC (private service connection) regional forwarding + rules. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscConnectionId: Optional[str] = None + """ + The PSC connection id of the PSC Forwarding Rule. + """ + pscConnectionStatus: Optional[str] = None + """ + The PSC connection status of the PSC Forwarding Rule. Possible values: STATUS_UNSPECIFIED, PENDING, ACCEPTED, REJECTED, CLOSED + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + region: Optional[str] = None + """ + A reference to the region where the regional forwarding rule resides. + This field is not applicable to global forwarding rules. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + serviceName: Optional[str] = None + """ + The internal fully qualified service name for this Forwarding Rule. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ForwardingRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['ForwardingRule']] = 'ForwardingRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ForwardingRuleSpec defines the desired state of ForwardingRule + """ + status: Optional[Status] = None + """ + ForwardingRuleStatus defines the observed state of ForwardingRule. + """ + + +class ForwardingRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ForwardingRule] + """ + List of forwardingrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/globaladdress/__init__.py b/schemas/python/models/io/upbound/gcp/compute/globaladdress/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/globaladdress/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/globaladdress/v1beta1.py new file mode 100644 index 000000000..9ad39201e --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/globaladdress/v1beta1.py @@ -0,0 +1,413 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_globaladdress.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + address: Optional[str] = None + """ + The IP address or beginning of the address range represented by this + resource. This can be supplied as an input to reserve a specific + address or omitted to allow GCP to choose a valid one for you. + """ + addressType: Optional[str] = None + """ + The type of the address to reserve. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the IP range. The IP range + must be in RFC1918 space. The network cannot be deleted if there are + any reserved IP ranges referring to it. + This should only be set when using an Internal address. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + prefixLength: Optional[float] = None + """ + The prefix length of the IP range. If not present, it means the + address field is a single IP address. + This field is not applicable to addresses with addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. Possible values include: + """ + + +class InitProvider(BaseModel): + address: Optional[str] = None + """ + The IP address or beginning of the address range represented by this + resource. This can be supplied as an input to reserve a specific + address or omitted to allow GCP to choose a valid one for you. + """ + addressType: Optional[str] = None + """ + The type of the address to reserve. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the IP range. The IP range + must be in RFC1918 space. The network cannot be deleted if there are + any reserved IP ranges referring to it. + This should only be set when using an Internal address. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + prefixLength: Optional[float] = None + """ + The prefix length of the IP range. If not present, it means the + address field is a single IP address. + This field is not applicable to addresses with addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. Possible values include: + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + address: Optional[str] = None + """ + The IP address or beginning of the address range represented by this + resource. This can be supplied as an input to reserve a specific + address or omitted to allow GCP to choose a valid one for you. + """ + addressType: Optional[str] = None + """ + The type of the address to reserve. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/addresses/{{name}} + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the IP range. The IP range + must be in RFC1918 space. The network cannot be deleted if there are + any reserved IP ranges referring to it. + This should only be set when using an Internal address. + """ + prefixLength: Optional[float] = None + """ + The prefix length of the IP range. If not present, it means the + address field is a single IP address. + This field is not applicable to addresses with addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. Possible values include: + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalAddress(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalAddress']] = 'GlobalAddress' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalAddressSpec defines the desired state of GlobalAddress + """ + status: Optional[Status] = None + """ + GlobalAddressStatus defines the observed state of GlobalAddress. + """ + + +class GlobalAddressList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalAddress] + """ + List of globaladdresses. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/__init__.py b/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta1.py new file mode 100644 index 000000000..7e647f45e --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta1.py @@ -0,0 +1,956 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_globalforwardingrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class IpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + Name of the resource; provided by the client when the resource is created. + The name must be 1-63 characters long, and comply with + RFC1035. + Specifically, the name must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters must + be a dash, lowercase letter, or digit, except the last character, which + cannot be a dash. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, the forwarding rule name must be a 1-20 characters string with + lowercase letters and numbers and must start with a letter. + """ + value: Optional[str] = None + """ + The value that the label must match. The value has a maximum + length of 1024 characters. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the + provided metadata based on filterMatchCriteria + This list must not be empty and can have at the most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of + filterLabels contribute towards the overall metadataFilter match. + MATCH_ANY - At least one of the filterLabels must have a matching + label in the provided metadata. + MATCH_ALL - All filterLabels must have matching labels in the + provided metadata. + Possible values are: MATCH_ANY, MATCH_ALL. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceDirectoryRegistration(BaseModel): + namespace: Optional[str] = None + """ + Service Directory namespace to register the forwarding rule under. + """ + serviceDirectoryRegion: Optional[str] = None + """ + [Optional] Service Directory region to register this global forwarding rule under. + Default to "us-central1". Only used for PSC for Google APIs. All PSC for + Google APIs Forwarding Rules on the same network should use the same Service + Directory region. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a GlobalAddress in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a GlobalAddress in compute to populate ipAddress. + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Network in compute to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Network in compute to populate project. + """ + serviceDirectoryRegistrations: Optional[List[ServiceDirectoryRegistration]] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a TargetSSLProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a TargetSSLProxy in compute to populate target. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a GlobalAddress in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a GlobalAddress in compute to populate ipAddress. + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Network in compute to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Network in compute to populate project. + """ + serviceDirectoryRegistrations: Optional[List[ServiceDirectoryRegistration]] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a TargetSSLProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a TargetSSLProxy in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + baseForwardingRule: Optional[str] = None + """ + [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + forwardingRuleId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/forwardingRules/{{name}} + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscConnectionId: Optional[str] = None + """ + The PSC connection id of the PSC Forwarding Rule. + """ + pscConnectionStatus: Optional[str] = None + """ + The PSC connection status of the PSC Forwarding Rule. Possible values: STATUS_UNSPECIFIED, PENDING, ACCEPTED, REJECTED, CLOSED + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceDirectoryRegistrations: Optional[List[ServiceDirectoryRegistration]] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalForwardingRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalForwardingRule']] = 'GlobalForwardingRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalForwardingRuleSpec defines the desired state of GlobalForwardingRule + """ + status: Optional[Status] = None + """ + GlobalForwardingRuleStatus defines the observed state of GlobalForwardingRule. + """ + + +class GlobalForwardingRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalForwardingRule] + """ + List of globalforwardingrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta2.py new file mode 100644 index 000000000..715981096 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/globalforwardingrule/v1beta2.py @@ -0,0 +1,956 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_globalforwardingrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class IpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + Name of the resource; provided by the client when the resource is created. + The name must be 1-63 characters long, and comply with + RFC1035. + Specifically, the name must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters must + be a dash, lowercase letter, or digit, except the last character, which + cannot be a dash. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, the forwarding rule name must be a 1-20 characters string with + lowercase letters and numbers and must start with a letter. + """ + value: Optional[str] = None + """ + The value that the label must match. The value has a maximum + length of 1024 characters. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the + provided metadata based on filterMatchCriteria + This list must not be empty and can have at the most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of + filterLabels contribute towards the overall metadataFilter match. + MATCH_ANY - At least one of the filterLabels must have a matching + label in the provided metadata. + MATCH_ALL - All filterLabels must have matching labels in the + provided metadata. + Possible values are: MATCH_ANY, MATCH_ALL. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceDirectoryRegistrations(BaseModel): + namespace: Optional[str] = None + """ + Service Directory namespace to register the forwarding rule under. + """ + serviceDirectoryRegion: Optional[str] = None + """ + [Optional] Service Directory region to register this global forwarding rule under. + Default to "us-central1". Only used for PSC for Google APIs. All PSC for + Google APIs Forwarding Rules on the same network should use the same Service + Directory region. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a GlobalAddress in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a GlobalAddress in compute to populate ipAddress. + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Network in compute to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Network in compute to populate project. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a TargetSSLProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a TargetSSLProxy in compute to populate target. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a GlobalAddress in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a GlobalAddress in compute to populate ipAddress. + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Network in compute to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Network in compute to populate project. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a TargetSSLProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a TargetSSLProxy in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + baseForwardingRule: Optional[str] = None + """ + [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + forwardingRuleId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/forwardingRules/{{name}} + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscConnectionId: Optional[str] = None + """ + The PSC connection id of the PSC Forwarding Rule. + """ + pscConnectionStatus: Optional[str] = None + """ + The PSC connection status of the PSC Forwarding Rule. Possible values: STATUS_UNSPECIFIED, PENDING, ACCEPTED, REJECTED, CLOSED + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalForwardingRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['GlobalForwardingRule']] = 'GlobalForwardingRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalForwardingRuleSpec defines the desired state of GlobalForwardingRule + """ + status: Optional[Status] = None + """ + GlobalForwardingRuleStatus defines the observed state of GlobalForwardingRule. + """ + + +class GlobalForwardingRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalForwardingRule] + """ + List of globalforwardingrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpoint/__init__.py b/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpoint/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpoint/v1beta1.py new file mode 100644 index 000000000..38f58bf78 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpoint/v1beta1.py @@ -0,0 +1,323 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_globalnetworkendpoint.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GlobalNetworkEndpointGroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GlobalNetworkEndpointGroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + globalNetworkEndpointGroup: Optional[str] = None + """ + The global network endpoint group this endpoint is part of. + """ + globalNetworkEndpointGroupRef: Optional[GlobalNetworkEndpointGroupRef] = None + """ + Reference to a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + globalNetworkEndpointGroupSelector: Optional[GlobalNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + """ + port: Optional[float] = None + """ + Port number of the external endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + globalNetworkEndpointGroup: Optional[str] = None + """ + The global network endpoint group this endpoint is part of. + """ + globalNetworkEndpointGroupRef: Optional[GlobalNetworkEndpointGroupRef] = None + """ + Reference to a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + globalNetworkEndpointGroupSelector: Optional[GlobalNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + """ + port: Optional[float] = None + """ + Port number of the external endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + globalNetworkEndpointGroup: Optional[str] = None + """ + The global network endpoint group this endpoint is part of. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + """ + port: Optional[float] = None + """ + Port number of the external endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalNetworkEndpoint(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalNetworkEndpoint']] = 'GlobalNetworkEndpoint' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalNetworkEndpointSpec defines the desired state of GlobalNetworkEndpoint + """ + status: Optional[Status] = None + """ + GlobalNetworkEndpointStatus defines the observed state of GlobalNetworkEndpoint. + """ + + +class GlobalNetworkEndpointList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalNetworkEndpoint] + """ + List of globalnetworkendpoints. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpointgroup/__init__.py b/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpointgroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpointgroup/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpointgroup/v1beta1.py new file mode 100644 index 000000000..d26a59954 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/globalnetworkendpointgroup/v1beta1.py @@ -0,0 +1,274 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_globalnetworkendpointgroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + Possible values are: INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + Possible values are: INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/networkEndpointGroups/{{name}} + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + Possible values are: INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalNetworkEndpointGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalNetworkEndpointGroup']] = 'GlobalNetworkEndpointGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalNetworkEndpointGroupSpec defines the desired state of GlobalNetworkEndpointGroup + """ + status: Optional[Status] = None + """ + GlobalNetworkEndpointGroupStatus defines the observed state of GlobalNetworkEndpointGroup. + """ + + +class GlobalNetworkEndpointGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalNetworkEndpointGroup] + """ + List of globalnetworkendpointgroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/havpngateway/__init__.py b/schemas/python/models/io/upbound/gcp/compute/havpngateway/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/havpngateway/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/havpngateway/v1beta1.py new file mode 100644 index 000000000..6bd864c5c --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/havpngateway/v1beta1.py @@ -0,0 +1,462 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_havpngateway.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class InterconnectAttachmentRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InterconnectAttachmentSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class VpnInterface(BaseModel): + id: Optional[float] = None + """ + The numeric ID of this VPN gateway interface. + """ + interconnectAttachment: Optional[str] = None + """ + URL of the interconnect attachment resource. When the value + of this field is present, the VPN Gateway will be used for + IPsec-encrypted Cloud Interconnect; all Egress or Ingress + traffic for this VPN Gateway interface will go through the + specified interconnect attachment resource. + Not currently available publicly. + """ + interconnectAttachmentRef: Optional[InterconnectAttachmentRef] = None + """ + Reference to a InterconnectAttachment in compute to populate interconnectAttachment. + """ + interconnectAttachmentSelector: Optional[InterconnectAttachmentSelector] = None + """ + Selector for a InterconnectAttachment in compute to populate interconnectAttachment. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + gatewayIpVersion: Optional[str] = None + """ + The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + Default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels method. + Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The region this gateway should sit in. + """ + stackType: Optional[str] = None + """ + The stack type for this VPN gateway to identify the IP protocols that are enabled. + If not specified, IPV4_ONLY will be used. + Default value is IPV4_ONLY. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + vpnInterfaces: Optional[List[VpnInterface]] = None + """ + A list of interfaces on this VPN gateway. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + gatewayIpVersion: Optional[str] = None + """ + The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + Default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels method. + Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + stackType: Optional[str] = None + """ + The stack type for this VPN gateway to identify the IP protocols that are enabled. + If not specified, IPV4_ONLY will be used. + Default value is IPV4_ONLY. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + vpnInterfaces: Optional[List[VpnInterface]] = None + """ + A list of interfaces on this VPN gateway. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class VpnInterfaceModel(BaseModel): + id: Optional[float] = None + """ + The numeric ID of this VPN gateway interface. + """ + interconnectAttachment: Optional[str] = None + """ + URL of the interconnect attachment resource. When the value + of this field is present, the VPN Gateway will be used for + IPsec-encrypted Cloud Interconnect; all Egress or Ingress + traffic for this VPN Gateway interface will go through the + specified interconnect attachment resource. + Not currently available publicly. + """ + ipAddress: Optional[str] = None + """ + (Output) + The external IP address for this VPN gateway interface. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + gatewayIpVersion: Optional[str] = None + """ + The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + Default value is IPV4. + Possible values are: IPV4, IPV6. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/vpnGateways/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash + of the labels set used for optimistic locking. The fingerprint is initially generated by + Compute Engine and changes after every request to modify or update labels. + You must always provide an up-to-date fingerprint hash in order to update or change labels, + otherwise the request will fail with error 412 conditionNotMet. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels method. + Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region this gateway should sit in. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + stackType: Optional[str] = None + """ + The stack type for this VPN gateway to identify the IP protocols that are enabled. + If not specified, IPV4_ONLY will be used. + Default value is IPV4_ONLY. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + vpnInterfaces: Optional[List[VpnInterfaceModel]] = None + """ + A list of interfaces on this VPN gateway. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HaVPNGateway(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['HaVPNGateway']] = 'HaVPNGateway' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HaVPNGatewaySpec defines the desired state of HaVPNGateway + """ + status: Optional[Status] = None + """ + HaVPNGatewayStatus defines the observed state of HaVPNGateway. + """ + + +class HaVPNGatewayList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HaVPNGateway] + """ + List of havpngateways. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/healthcheck/__init__.py b/schemas/python/models/io/upbound/gcp/compute/healthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta1.py new file mode 100644 index 000000000..e69e74f7b --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta1.py @@ -0,0 +1,681 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_healthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class GrpcHealthCheckItem(BaseModel): + grpcServiceName: Optional[str] = None + """ + The gRPC service name for the health check. + The value of grpcServiceName has the following meanings by convention: + """ + port: Optional[float] = None + """ + The port number for the health check request. + Must be specified if portName and portSpecification are not set + or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + + +class Http2HealthCheckItem(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP2 health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP2 health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP2 health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpHealthCheckItem(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpsHealthCheckItem(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class LogConfigItem(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. This is false by default, + which means no health check logging will be done. + """ + + +class SslHealthCheckItem(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the SSL health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the SSL connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class TcpHealthCheckItem(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the TCP health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the TCP connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[List[GrpcHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[List[Http2HealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpHealthCheck: Optional[List[HttpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpsHealthCheck: Optional[List[HttpsHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[List[SslHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + tcpHealthCheck: Optional[List[TcpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[List[GrpcHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[List[Http2HealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpHealthCheck: Optional[List[HttpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpsHealthCheck: Optional[List[HttpsHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[List[SslHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + tcpHealthCheck: Optional[List[TcpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[List[GrpcHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[List[Http2HealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpHealthCheck: Optional[List[HttpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpsHealthCheck: Optional[List[HttpsHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/healthChecks/{{name}} + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[List[SslHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + tcpHealthCheck: Optional[List[TcpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + type: Optional[str] = None + """ + The type of the health check. One of HTTP, HTTPS, TCP, or SSL. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['HealthCheck']] = 'HealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HealthCheckSpec defines the desired state of HealthCheck + """ + status: Optional[Status] = None + """ + HealthCheckStatus defines the observed state of HealthCheck. + """ + + +class HealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HealthCheck] + """ + List of healthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta2.py new file mode 100644 index 000000000..26341a7e0 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/healthcheck/v1beta2.py @@ -0,0 +1,681 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_healthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class GrpcHealthCheck(BaseModel): + grpcServiceName: Optional[str] = None + """ + The gRPC service name for the health check. + The value of grpcServiceName has the following meanings by convention: + """ + port: Optional[float] = None + """ + The port number for the health check request. + Must be specified if portName and portSpecification are not set + or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + + +class Http2HealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP2 health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP2 health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP2 health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpsHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. This is false by default, + which means no health check logging will be done. + """ + + +class SslHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the SSL health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the SSL connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class TcpHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the TCP health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the TCP connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/healthChecks/{{name}} + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + type: Optional[str] = None + """ + The type of the health check. One of HTTP, HTTPS, TCP, or SSL. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['HealthCheck']] = 'HealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HealthCheckSpec defines the desired state of HealthCheck + """ + status: Optional[Status] = None + """ + HealthCheckStatus defines the observed state of HealthCheck. + """ + + +class HealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HealthCheck] + """ + List of healthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/httphealthcheck/__init__.py b/schemas/python/models/io/upbound/gcp/compute/httphealthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/httphealthcheck/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/httphealthcheck/v1beta1.py new file mode 100644 index 000000000..5811c1f8a --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/httphealthcheck/v1beta1.py @@ -0,0 +1,359 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_httphealthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/httpHealthChecks/{{name}} + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HTTPHealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['HTTPHealthCheck']] = 'HTTPHealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HTTPHealthCheckSpec defines the desired state of HTTPHealthCheck + """ + status: Optional[Status] = None + """ + HTTPHealthCheckStatus defines the observed state of HTTPHealthCheck. + """ + + +class HTTPHealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HTTPHealthCheck] + """ + List of httphealthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/httpshealthcheck/__init__.py b/schemas/python/models/io/upbound/gcp/compute/httpshealthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/httpshealthcheck/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/httpshealthcheck/v1beta1.py new file mode 100644 index 000000000..3ecf50b05 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/httpshealthcheck/v1beta1.py @@ -0,0 +1,359 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_httpshealthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/httpsHealthChecks/{{name}} + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HTTPSHealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['HTTPSHealthCheck']] = 'HTTPSHealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HTTPSHealthCheckSpec defines the desired state of HTTPSHealthCheck + """ + status: Optional[Status] = None + """ + HTTPSHealthCheckStatus defines the observed state of HTTPSHealthCheck. + """ + + +class HTTPSHealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HTTPSHealthCheck] + """ + List of httpshealthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/image/__init__.py b/schemas/python/models/io/upbound/gcp/compute/image/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/image/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/image/v1beta1.py new file mode 100644 index 000000000..f9cad9e8d --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/image/v1beta1.py @@ -0,0 +1,886 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_image.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class ImageEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is stored in Google Cloud + KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class RawDiskItem(BaseModel): + containerType: Optional[str] = None + """ + The format used to encode and transmit the block device, which + should be TAR. This is just a container and transmission format + and not a runtime format. Provided by the client when the disk + image is created. + Default value is TAR. + Possible values are: TAR. + """ + sha1: Optional[str] = None + """ + An optional SHA1 checksum of the disk image before unpackaging. + This is provided by the client when the disk image is created. + """ + source: Optional[str] = None + """ + The full Google Cloud Storage URL where disk storage is stored + You must provide either this property or the sourceDisk property + but not both. + """ + + +class Db(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Dbx(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Kek(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class PkItem(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class ShieldedInstanceInitialStateItem(BaseModel): + dbs: Optional[List[Db]] = None + """ + The Key Database (db). + Structure is documented below. + """ + dbxs: Optional[List[Dbx]] = None + """ + The forbidden key database (dbx). + Structure is documented below. + """ + keks: Optional[List[Kek]] = None + """ + The Key Exchange Key (KEK). + Structure is documented below. + """ + pk: Optional[List[PkItem]] = None + """ + The Platform Key (PK). + Structure is documented below. + """ + + +class SourceDiskEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceDiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceDiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceImageEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class SourceSnapshotEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + imageEncryptionKey: Optional[List[ImageEncryptionKeyItem]] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[List[RawDiskItem]] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + shieldedInstanceInitialState: Optional[List[ShieldedInstanceInitialStateItem]] = ( + None + ) + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[List[SourceDiskEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + imageEncryptionKey: Optional[List[ImageEncryptionKeyItem]] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[List[RawDiskItem]] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + shieldedInstanceInitialState: Optional[List[ShieldedInstanceInitialStateItem]] = ( + None + ) + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[List[SourceDiskEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ImageEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is stored in Google Cloud + KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceDiskEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceImageEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceSnapshotEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class AtProvider(BaseModel): + archiveSizeBytes: Optional[float] = None + """ + Size of the image tar.gz archive stored in Google Cloud Storage (in + bytes). + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + effectiveLabels: Optional[Dict[str, str]] = None + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/images/{{name}} + """ + imageEncryptionKey: Optional[List[ImageEncryptionKeyItemModel]] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[List[RawDiskItem]] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shieldedInstanceInitialState: Optional[List[ShieldedInstanceInitialStateItem]] = ( + None + ) + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[List[SourceDiskEncryptionKeyItemModel]] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItemModel]] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[ + List[SourceSnapshotEncryptionKeyItemModel] + ] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Image(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Image']] = 'Image' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ImageSpec defines the desired state of Image + """ + status: Optional[Status] = None + """ + ImageStatus defines the observed state of Image. + """ + + +class ImageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Image] + """ + List of images. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/image/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/image/v1beta2.py new file mode 100644 index 000000000..b33c61510 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/image/v1beta2.py @@ -0,0 +1,878 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_image.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class ImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is stored in Google Cloud + KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class RawDisk(BaseModel): + containerType: Optional[str] = None + """ + The format used to encode and transmit the block device, which + should be TAR. This is just a container and transmission format + and not a runtime format. Provided by the client when the disk + image is created. + Default value is TAR. + Possible values are: TAR. + """ + sha1: Optional[str] = None + """ + An optional SHA1 checksum of the disk image before unpackaging. + This is provided by the client when the disk image is created. + """ + source: Optional[str] = None + """ + The full Google Cloud Storage URL where disk storage is stored + You must provide either this property or the sourceDisk property + but not both. + """ + + +class Db(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Dbx(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Kek(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Pk(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class ShieldedInstanceInitialState(BaseModel): + dbs: Optional[List[Db]] = None + """ + The Key Database (db). + Structure is documented below. + """ + dbxs: Optional[List[Dbx]] = None + """ + The forbidden key database (dbx). + Structure is documented below. + """ + keks: Optional[List[Kek]] = None + """ + The Key Exchange Key (KEK). + Structure is documented below. + """ + pk: Optional[Pk] = None + """ + The Platform Key (PK). + Structure is documented below. + """ + + +class SourceDiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceDiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceDiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + imageEncryptionKey: Optional[ImageEncryptionKey] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[RawDisk] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + shieldedInstanceInitialState: Optional[ShieldedInstanceInitialState] = None + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + imageEncryptionKey: Optional[ImageEncryptionKey] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[RawDisk] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + shieldedInstanceInitialState: Optional[ShieldedInstanceInitialState] = None + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is stored in Google Cloud + KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceDiskEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class AtProvider(BaseModel): + archiveSizeBytes: Optional[float] = None + """ + Size of the image tar.gz archive stored in Google Cloud Storage (in + bytes). + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + effectiveLabels: Optional[Dict[str, str]] = None + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/images/{{name}} + """ + imageEncryptionKey: Optional[ImageEncryptionKeyModel] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[RawDisk] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shieldedInstanceInitialState: Optional[ShieldedInstanceInitialState] = None + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Image(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Image']] = 'Image' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ImageSpec defines the desired state of Image + """ + status: Optional[Status] = None + """ + ImageStatus defines the observed state of Image. + """ + + +class ImageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Image] + """ + List of images. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/imageiammember/__init__.py b/schemas/python/models/io/upbound/gcp/compute/imageiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta1.py new file mode 100644 index 000000000..983c582d9 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta1.py @@ -0,0 +1,272 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_imageiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ImageRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ImageSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + image: Optional[str] = None + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + image: Optional[str] = None + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + image: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ImageIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ImageIAMMember']] = 'ImageIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ImageIAMMemberSpec defines the desired state of ImageIAMMember + """ + status: Optional[Status] = None + """ + ImageIAMMemberStatus defines the observed state of ImageIAMMember. + """ + + +class ImageIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ImageIAMMember] + """ + List of imageiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta2.py new file mode 100644 index 000000000..fdab197ca --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/imageiammember/v1beta2.py @@ -0,0 +1,272 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_imageiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ImageRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ImageSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + image: Optional[str] = None + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + image: Optional[str] = None + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + image: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ImageIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['ImageIAMMember']] = 'ImageIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ImageIAMMemberSpec defines the desired state of ImageIAMMember + """ + status: Optional[Status] = None + """ + ImageIAMMemberStatus defines the observed state of ImageIAMMember. + """ + + +class ImageIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ImageIAMMember] + """ + List of imageiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instance/__init__.py b/schemas/python/models/io/upbound/gcp/compute/instance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/instance/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/instance/v1beta1.py new file mode 100644 index 000000000..5dd28e72f --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instance/v1beta1.py @@ -0,0 +1,1922 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_instance.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeature(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + enableUefiNetworking: Optional[bool] = None + """ + Whether to enable UEFI networking for instance creation. + """ + performanceMonitoringUnit: Optional[str] = None + """ + The PMU is a hardware component within the CPU core that monitors how the processor runs code. Valid values for the level of PMU are STANDARD, ENHANCED, and ARCHITECTURAL. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + """ + turboMode: Optional[str] = None + """ + Turbo frequency mode to use for the instance. Supported modes are currently either ALL_CORE_MAX or unset (default). + """ + visibleCoreCount: Optional[float] = None + """ + The number of physical cores to expose to an instance. visible cores info (VC). + """ + + +class DiskEncryptionKeyRawSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKeyRsaSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class AttachedDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + Name with which the attached disk will be accessible + under /dev/disk/by-id/google-* + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + Either "READ_ONLY" or "READ_WRITE", defaults to "READ_WRITE" + If you have a persistent disk with data that you want to share + between multiple instances, detach it from any read-write instances and + attach it to one or more instances in read-only mode. + """ + source: Optional[str] = None + """ + The name or self_link of the disk to attach to this instance. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ImageRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ImageSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SourceImageEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class SourceSnapshotEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class InitializeParam(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. + This sets the number of I/O operations per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of IOPS every 4 hours. To update your hyperdisk more frequently, + you'll need to manually delete and recreate it. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. + This sets the number of throughput mb per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of throughput every 4 hours. To update your hyperdisk more + frequently, you'll need to manually delete and recreate it. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + snapshot: Optional[str] = None + """ + The snapshot from which to initialize this disk. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItem]] = None + """ + Encryption key used to decrypt the given image. Structure is documented below. + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + Encryption key used to decrypt the given snapshot. Structure is documented below. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class BootDiskItem(BaseModel): + autoDelete: Optional[bool] = None + """ + Whether the disk will be auto-deleted when the instance + is deleted. Defaults to true. + """ + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + initializeParams: Optional[List[InitializeParam]] = None + """ + Parameters for a new disk that will be created + alongside the new instance. Either initialize_params or source must be set. + Structure is documented below. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, + disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + """ + source: Optional[str] = None + """ + The name or self_link of the existing disk (such as those managed by + google_compute_disk) or disk image. To create an instance from a snapshot, first create a + google_compute_disk from a snapshot and reference it here. + """ + + +class ConfidentialInstanceConfigItem(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the confidential computing technology the instance uses. SEV is an AMD feature. TDX is an Intel feature. One of the following values is required: SEV, SEV_SNP, TDX. on_host_maintenance can be set to MIGRATE if confidential_instance_type is set to SEV and min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. If SEV_SNP, currently min_cpu_platform has to be set to "AMD Milan" or this will fail to create the VM. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Defines whether the instance should have confidential compute enabled with AMD SEV. If enabled, on_host_maintenance can be set to MIGRATE if min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class InstanceEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt the data on this instance. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + """ + If the instance has an access config, either the given external ip (in the nat_ip field) or the ephemeral (generated) ip (if you didn't provide one). + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM or STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The domain name to be used when creating DNSv6 + records for the external IPv6 ranges.. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The IP CIDR range represented by this alias IP range. This IP CIDR range + must belong to the specified subnetwork and cannot contain IP addresses reserved by + system or used by other network interfaces. This range may be a single IP address + (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24). + """ + subnetworkRangeName: Optional[str] = None + """ + The subnetwork secondary range name specifying + the secondary range from which to allocate the IP CIDR range for this alias IP + range. If left unspecified, the primary range of the subnetwork will be used. + """ + + +class Ipv6AccessConfigItem(BaseModel): + externalIpv6: Optional[str] = None + """ + The first IPv6 address of the external IPv6 range associated + with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. + To use a static external IP address, it must be unused and in the same region as the instance's zone. + If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork. + """ + externalIpv6PrefixLength: Optional[str] = None + """ + The prefix length of the external IPv6 range. + """ + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM or STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The domain name to be used when creating DNSv6 + records for the external IPv6 ranges.. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet. Omit to ensure that the instance + is not accessible from the Internet.g. via + tunnel or because it is running on another cloud instance on that network). + This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6Address: Optional[str] = None + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Either network or subnetwork must be provided. If network isn't provided it will + be inferred from the subnetwork. + """ + networkAttachment: Optional[str] = None + """ + The URL of the network attachment that this interface should connect to in the following format: projects/{projectNumber}/regions/{region_name}/networkAttachments/{network_attachment_name}. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, IDPF, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the subnetwork to attach this + interface to. Either network or subnetwork must be provided. If network isn't provided + it will be inferred from the subnetwork. The subnetwork must exist in the same region this + instance will be created in. If the network resource is in + legacy mode, do not specify this field. If the + network is in auto subnet mode, specifying the subnetwork is optional. If the network is + in custom subnet mode, specifying the subnetwork is required. + """ + subnetworkProject: Optional[str] = None + """ + The project in which the subnetwork belongs. + If the subnetwork is a self_link, this field is set to the project + defined in the subnetwork self_link. If the subnetwork is a name and this + field is not provided, the provider project is used. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfigItem(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + The egress bandwidth tier to enable. + Possible values: TIER_1, DEFAULT + """ + + +class Param(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + + +class SpecificReservationItem(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class ReservationAffinityItem(BaseModel): + specificReservation: Optional[List[SpecificReservationItem]] = None + """ + Specifies the label selector for the reservation to use.. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class LocalSsdRecoveryTimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class MaxRunDurationItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + operator: Optional[str] = None + """ + The operator. Can be IN for node-affinities + or NOT_IN for anti-affinities. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class OnInstanceStopActionItem(BaseModel): + discardLocalSsd: Optional[bool] = None + """ + Whether to discard local SSDs attached to the VM while terminating using max_run_duration. Only supports true at this point. + """ + + +class SchedulingItem(BaseModel): + automaticRestart: Optional[bool] = None + """ + Specifies if the instance should be + restarted if it was terminated by Compute Engine (not a user). + Defaults to true. + """ + availabilityDomain: Optional[float] = None + """ + Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + """ + instanceTerminationAction: Optional[str] = None + """ + Describe the type of termination action for VM. Can be STOP or DELETE. Read more on here + """ + localSsdRecoveryTimeout: Optional[List[LocalSsdRecoveryTimeoutItem]] = None + """ + io/docs/providers/google/guides/provider_versions.html) Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. Structure is documented below. + """ + maxRunDuration: Optional[List[MaxRunDurationItem]] = None + """ + The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in instance_termination_action. Structure is documented below. + """ + minNodeCpus: Optional[float] = None + """ + The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + """ + nodeAffinities: Optional[List[NodeAffinity]] = None + """ + Specifies node affinities or anti-affinities + to determine which sole-tenant nodes your instances and managed instance + groups will use as host systems. Read more on sole-tenant node creation + here. + Structure documented below. + """ + onHostMaintenance: Optional[str] = None + """ + Describes maintenance behavior for the + instance. Can be MIGRATE or TERMINATE, for more info, read + here. + """ + onInstanceStopAction: Optional[List[OnInstanceStopActionItem]] = None + """ + Specifies the action to be performed when the instance is terminated using max_run_duration and STOP instance_termination_action. Only support true discard_local_ssd at this point. Structure is documented below. + """ + preemptible: Optional[bool] = None + """ + Specifies if the instance is preemptible. + If this field is set to true, then automatic_restart must be + set to false. Defaults to false. + """ + provisioningModel: Optional[str] = None + """ + Describe the type of preemptible VM. This field accepts the value STANDARD or SPOT. If the value is STANDARD, there will be no discount. If this is set to SPOT, + preemptible should be true and automatic_restart should be + false. For more info about + SPOT, read here + """ + terminationTime: Optional[str] = None + """ + Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + """ + + +class ScratchDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + + +class EmailRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EmailSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceAccountItem(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + emailRef: Optional[EmailRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate email. + """ + emailSelector: Optional[EmailSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate email. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class ShieldedInstanceConfigItem(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + - Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + enableSecureBoot: Optional[bool] = None + """ + - Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + enableVtpm: Optional[bool] = None + """ + - Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[List[BootDiskItem]] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[List[InstanceEncryptionKeyItem]] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[List[Param]] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[List[SchedulingItem]] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + serviceAccount: Optional[List[ServiceAccountItem]] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + zone: str + """ + The zone that the machine should be created in. If it is not provided, the provider zone is used. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[List[BootDiskItem]] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[List[InstanceEncryptionKeyItem]] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[List[Param]] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[List[SchedulingItem]] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + serviceAccount: Optional[List[ServiceAccountItem]] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AttachedDiskItemModel(BaseModel): + deviceName: Optional[str] = None + """ + Name with which the attached disk will be accessible + under /dev/disk/by-id/google-* + """ + diskEncryptionKeySha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + Either "READ_ONLY" or "READ_WRITE", defaults to "READ_WRITE" + If you have a persistent disk with data that you want to share + between multiple instances, detach it from any read-write instances and + attach it to one or more instances in read-only mode. + """ + source: Optional[str] = None + """ + The name or self_link of the disk to attach to this instance. + """ + + +class SourceImageEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class InitializeParamModel(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. + This sets the number of I/O operations per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of IOPS every 4 hours. To update your hyperdisk more frequently, + you'll need to manually delete and recreate it. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. + This sets the number of throughput mb per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of throughput every 4 hours. To update your hyperdisk more + frequently, you'll need to manually delete and recreate it. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + snapshot: Optional[str] = None + """ + The snapshot from which to initialize this disk. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItemModel]] = None + """ + Encryption key used to decrypt the given image. Structure is documented below. + """ + sourceSnapshotEncryptionKey: Optional[ + List[SourceSnapshotEncryptionKeyItemModel] + ] = None + """ + Encryption key used to decrypt the given snapshot. Structure is documented below. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class BootDiskItemModel(BaseModel): + autoDelete: Optional[bool] = None + """ + Whether the disk will be auto-deleted when the instance + is deleted. Defaults to true. + """ + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + diskEncryptionKeySha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + initializeParams: Optional[List[InitializeParamModel]] = None + """ + Parameters for a new disk that will be created + alongside the new instance. Either initialize_params or source must be set. + Structure is documented below. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, + disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + """ + source: Optional[str] = None + """ + The name or self_link of the existing disk (such as those managed by + google_compute_disk) or disk image. To create an instance from a snapshot, first create a + google_compute_disk from a snapshot and reference it here. + """ + + +class InstanceEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt the data on this instance. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet. Omit to ensure that the instance + is not accessible from the Internet.g. via + tunnel or because it is running on another cloud instance on that network). + This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6AccessType: Optional[str] = None + """ + One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. + This field is always inherited from its subnetwork. + """ + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Either network or subnetwork must be provided. If network isn't provided it will + be inferred from the subnetwork. + """ + networkAttachment: Optional[str] = None + """ + The URL of the network attachment that this interface should connect to in the following format: projects/{projectNumber}/regions/{region_name}/networkAttachments/{network_attachment_name}. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, IDPF, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the subnetwork to attach this + interface to. Either network or subnetwork must be provided. If network isn't provided + it will be inferred from the subnetwork. The subnetwork must exist in the same region this + instance will be created in. If the network resource is in + legacy mode, do not specify this field. If the + network is in auto subnet mode, specifying the subnetwork is optional. If the network is + in custom subnet mode, specifying the subnetwork is required. + """ + subnetworkProject: Optional[str] = None + """ + The project in which the subnetwork belongs. + If the subnetwork is a self_link, this field is set to the project + defined in the subnetwork self_link. If the subnetwork is a name and this + field is not provided, the provider project is used. + """ + + +class ServiceAccountItemModel(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItemModel]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[List[BootDiskItemModel]] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + cpuPlatform: Optional[str] = None + """ + The CPU platform used by this instance. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + currentStatus: Optional[str] = None + """ + The current status of the instance. This could be one of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + effectiveLabels: Optional[Dict[str, str]] = None + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instances/{{name}} + """ + instanceEncryptionKey: Optional[List[InstanceEncryptionKeyItemModel]] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + instanceId: Optional[str] = None + """ + The server-assigned unique identifier of this instance. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labelFingerprint: Optional[str] = None + """ + The unique fingerprint of the labels. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataFingerprint: Optional[str] = None + """ + The unique fingerprint of the metadata. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[List[Param]] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[List[SchedulingItem]] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceAccount: Optional[List[ServiceAccountItemModel]] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + tagsFingerprint: Optional[str] = None + """ + The unique fingerprint of the tags. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + zone: Optional[str] = None + """ + The zone that the machine should be created in. If it is not provided, the provider zone is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Instance(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Instance']] = 'Instance' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceSpec defines the desired state of Instance + """ + status: Optional[Status] = None + """ + InstanceStatus defines the observed state of Instance. + """ + + +class InstanceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Instance] + """ + List of instances. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instance/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/instance/v1beta2.py new file mode 100644 index 000000000..ffaadcb28 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instance/v1beta2.py @@ -0,0 +1,1920 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_instance.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + enableUefiNetworking: Optional[bool] = None + """ + Whether to enable UEFI networking for instance creation. + """ + performanceMonitoringUnit: Optional[str] = None + """ + The PMU is a hardware component within the CPU core that monitors how the processor runs code. Valid values for the level of PMU are STANDARD, ENHANCED, and ARCHITECTURAL. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + """ + turboMode: Optional[str] = None + """ + Turbo frequency mode to use for the instance. Supported modes are currently either ALL_CORE_MAX or unset (default). + """ + visibleCoreCount: Optional[float] = None + """ + The number of physical cores to expose to an instance. visible cores info (VC). + """ + + +class DiskEncryptionKeyRawSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKeyRsaSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class AttachedDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + Name with which the attached disk will be accessible + under /dev/disk/by-id/google-* + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + Either "READ_ONLY" or "READ_WRITE", defaults to "READ_WRITE" + If you have a persistent disk with data that you want to share + between multiple instances, detach it from any read-write instances and + attach it to one or more instances in read-only mode. + """ + source: Optional[str] = None + """ + The name or self_link of the disk to attach to this instance. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ImageRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ImageSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class InitializeParams(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. + This sets the number of I/O operations per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of IOPS every 4 hours. To update your hyperdisk more frequently, + you'll need to manually delete and recreate it. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. + This sets the number of throughput mb per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of throughput every 4 hours. To update your hyperdisk more + frequently, you'll need to manually delete and recreate it. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + snapshot: Optional[str] = None + """ + The snapshot from which to initialize this disk. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + Encryption key used to decrypt the given image. Structure is documented below. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + Encryption key used to decrypt the given snapshot. Structure is documented below. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class BootDisk(BaseModel): + autoDelete: Optional[bool] = None + """ + Whether the disk will be auto-deleted when the instance + is deleted. Defaults to true. + """ + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + initializeParams: Optional[InitializeParams] = None + """ + Parameters for a new disk that will be created + alongside the new instance. Either initialize_params or source must be set. + Structure is documented below. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, + disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + """ + source: Optional[str] = None + """ + The name or self_link of the existing disk (such as those managed by + google_compute_disk) or disk image. To create an instance from a snapshot, first create a + google_compute_disk from a snapshot and reference it here. + """ + + +class ConfidentialInstanceConfig(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the confidential computing technology the instance uses. SEV is an AMD feature. TDX is an Intel feature. One of the following values is required: SEV, SEV_SNP, TDX. on_host_maintenance can be set to MIGRATE if confidential_instance_type is set to SEV and min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. If SEV_SNP, currently min_cpu_platform has to be set to "AMD Milan" or this will fail to create the VM. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Defines whether the instance should have confidential compute enabled with AMD SEV. If enabled, on_host_maintenance can be set to MIGRATE if min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class InstanceEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt the data on this instance. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + """ + If the instance has an access config, either the given external ip (in the nat_ip field) or the ephemeral (generated) ip (if you didn't provide one). + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM or STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The domain name to be used when creating DNSv6 + records for the external IPv6 ranges.. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The IP CIDR range represented by this alias IP range. This IP CIDR range + must belong to the specified subnetwork and cannot contain IP addresses reserved by + system or used by other network interfaces. This range may be a single IP address + (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24). + """ + subnetworkRangeName: Optional[str] = None + """ + The subnetwork secondary range name specifying + the secondary range from which to allocate the IP CIDR range for this alias IP + range. If left unspecified, the primary range of the subnetwork will be used. + """ + + +class Ipv6AccessConfigItem(BaseModel): + externalIpv6: Optional[str] = None + """ + The first IPv6 address of the external IPv6 range associated + with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. + To use a static external IP address, it must be unused and in the same region as the instance's zone. + If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork. + """ + externalIpv6PrefixLength: Optional[str] = None + """ + The prefix length of the external IPv6 range. + """ + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM or STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The domain name to be used when creating DNSv6 + records for the external IPv6 ranges.. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet. Omit to ensure that the instance + is not accessible from the Internet.g. via + tunnel or because it is running on another cloud instance on that network). + This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6Address: Optional[str] = None + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Either network or subnetwork must be provided. If network isn't provided it will + be inferred from the subnetwork. + """ + networkAttachment: Optional[str] = None + """ + The URL of the network attachment that this interface should connect to in the following format: projects/{projectNumber}/regions/{region_name}/networkAttachments/{network_attachment_name}. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, IDPF, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the subnetwork to attach this + interface to. Either network or subnetwork must be provided. If network isn't provided + it will be inferred from the subnetwork. The subnetwork must exist in the same region this + instance will be created in. If the network resource is in + legacy mode, do not specify this field. If the + network is in auto subnet mode, specifying the subnetwork is optional. If the network is + in custom subnet mode, specifying the subnetwork is required. + """ + subnetworkProject: Optional[str] = None + """ + The project in which the subnetwork belongs. + If the subnetwork is a self_link, this field is set to the project + defined in the subnetwork self_link. If the subnetwork is a name and this + field is not provided, the provider project is used. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + The egress bandwidth tier to enable. + Possible values: TIER_1, DEFAULT + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + + +class SpecificReservation(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class ReservationAffinity(BaseModel): + specificReservation: Optional[SpecificReservation] = None + """ + Specifies the label selector for the reservation to use.. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class LocalSsdRecoveryTimeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class MaxRunDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + operator: Optional[str] = None + """ + The operator. Can be IN for node-affinities + or NOT_IN for anti-affinities. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class OnInstanceStopAction(BaseModel): + discardLocalSsd: Optional[bool] = None + """ + Whether to discard local SSDs attached to the VM while terminating using max_run_duration. Only supports true at this point. + """ + + +class Scheduling(BaseModel): + automaticRestart: Optional[bool] = None + """ + Specifies if the instance should be + restarted if it was terminated by Compute Engine (not a user). + Defaults to true. + """ + availabilityDomain: Optional[float] = None + """ + Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + """ + instanceTerminationAction: Optional[str] = None + """ + Describe the type of termination action for VM. Can be STOP or DELETE. Read more on here + """ + localSsdRecoveryTimeout: Optional[LocalSsdRecoveryTimeout] = None + """ + io/docs/providers/google/guides/provider_versions.html) Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. Structure is documented below. + """ + maxRunDuration: Optional[MaxRunDuration] = None + """ + The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in instance_termination_action. Structure is documented below. + """ + minNodeCpus: Optional[float] = None + """ + The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + """ + nodeAffinities: Optional[List[NodeAffinity]] = None + """ + Specifies node affinities or anti-affinities + to determine which sole-tenant nodes your instances and managed instance + groups will use as host systems. Read more on sole-tenant node creation + here. + Structure documented below. + """ + onHostMaintenance: Optional[str] = None + """ + Describes maintenance behavior for the + instance. Can be MIGRATE or TERMINATE, for more info, read + here. + """ + onInstanceStopAction: Optional[OnInstanceStopAction] = None + """ + Specifies the action to be performed when the instance is terminated using max_run_duration and STOP instance_termination_action. Only support true discard_local_ssd at this point. Structure is documented below. + """ + preemptible: Optional[bool] = None + """ + Specifies if the instance is preemptible. + If this field is set to true, then automatic_restart must be + set to false. Defaults to false. + """ + provisioningModel: Optional[str] = None + """ + Describe the type of preemptible VM. This field accepts the value STANDARD or SPOT. If the value is STANDARD, there will be no discount. If this is set to SPOT, + preemptible should be true and automatic_restart should be + false. For more info about + SPOT, read here + """ + terminationTime: Optional[str] = None + """ + Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + """ + + +class ScratchDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + + +class EmailRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EmailSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceAccount(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + emailRef: Optional[EmailRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate email. + """ + emailSelector: Optional[EmailSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate email. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + - Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + enableSecureBoot: Optional[bool] = None + """ + - Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + enableVtpm: Optional[bool] = None + """ + - Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[BootDisk] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[Params] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + zone: str + """ + The zone that the machine should be created in. If it is not provided, the provider zone is used. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[BootDisk] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[Params] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AttachedDiskItemModel(BaseModel): + deviceName: Optional[str] = None + """ + Name with which the attached disk will be accessible + under /dev/disk/by-id/google-* + """ + diskEncryptionKeySha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + Either "READ_ONLY" or "READ_WRITE", defaults to "READ_WRITE" + If you have a persistent disk with data that you want to share + between multiple instances, detach it from any read-write instances and + attach it to one or more instances in read-only mode. + """ + source: Optional[str] = None + """ + The name or self_link of the disk to attach to this instance. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class InitializeParamsModel(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. + This sets the number of I/O operations per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of IOPS every 4 hours. To update your hyperdisk more frequently, + you'll need to manually delete and recreate it. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. + This sets the number of throughput mb per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of throughput every 4 hours. To update your hyperdisk more + frequently, you'll need to manually delete and recreate it. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + snapshot: Optional[str] = None + """ + The snapshot from which to initialize this disk. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + Encryption key used to decrypt the given image. Structure is documented below. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + Encryption key used to decrypt the given snapshot. Structure is documented below. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class BootDiskModel(BaseModel): + autoDelete: Optional[bool] = None + """ + Whether the disk will be auto-deleted when the instance + is deleted. Defaults to true. + """ + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + diskEncryptionKeySha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + initializeParams: Optional[InitializeParamsModel] = None + """ + Parameters for a new disk that will be created + alongside the new instance. Either initialize_params or source must be set. + Structure is documented below. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, + disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + """ + source: Optional[str] = None + """ + The name or self_link of the existing disk (such as those managed by + google_compute_disk) or disk image. To create an instance from a snapshot, first create a + google_compute_disk from a snapshot and reference it here. + """ + + +class InstanceEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt the data on this instance. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet. Omit to ensure that the instance + is not accessible from the Internet.g. via + tunnel or because it is running on another cloud instance on that network). + This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6AccessType: Optional[str] = None + """ + One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. + This field is always inherited from its subnetwork. + """ + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Either network or subnetwork must be provided. If network isn't provided it will + be inferred from the subnetwork. + """ + networkAttachment: Optional[str] = None + """ + The URL of the network attachment that this interface should connect to in the following format: projects/{projectNumber}/regions/{region_name}/networkAttachments/{network_attachment_name}. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, IDPF, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the subnetwork to attach this + interface to. Either network or subnetwork must be provided. If network isn't provided + it will be inferred from the subnetwork. The subnetwork must exist in the same region this + instance will be created in. If the network resource is in + legacy mode, do not specify this field. If the + network is in auto subnet mode, specifying the subnetwork is optional. If the network is + in custom subnet mode, specifying the subnetwork is required. + """ + subnetworkProject: Optional[str] = None + """ + The project in which the subnetwork belongs. + If the subnetwork is a self_link, this field is set to the project + defined in the subnetwork self_link. If the subnetwork is a name and this + field is not provided, the provider project is used. + """ + + +class ServiceAccountModel(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItemModel]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[BootDiskModel] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + cpuPlatform: Optional[str] = None + """ + The CPU platform used by this instance. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + currentStatus: Optional[str] = None + """ + The current status of the instance. This could be one of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + effectiveLabels: Optional[Dict[str, str]] = None + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instances/{{name}} + """ + instanceEncryptionKey: Optional[InstanceEncryptionKeyModel] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + instanceId: Optional[str] = None + """ + The server-assigned unique identifier of this instance. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labelFingerprint: Optional[str] = None + """ + The unique fingerprint of the labels. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataFingerprint: Optional[str] = None + """ + The unique fingerprint of the metadata. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[Params] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceAccount: Optional[ServiceAccountModel] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + tagsFingerprint: Optional[str] = None + """ + The unique fingerprint of the tags. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + zone: Optional[str] = None + """ + The zone that the machine should be created in. If it is not provided, the provider zone is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Instance(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Instance']] = 'Instance' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceSpec defines the desired state of Instance + """ + status: Optional[Status] = None + """ + InstanceStatus defines the observed state of Instance. + """ + + +class InstanceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Instance] + """ + List of instances. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/__init__.py b/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta1.py new file mode 100644 index 000000000..3d2d3a00a --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta1.py @@ -0,0 +1,865 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_instancefromtemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeature(BaseModel): + enableNestedVirtualization: Optional[bool] = None + enableUefiNetworking: Optional[bool] = None + performanceMonitoringUnit: Optional[str] = None + threadsPerCore: Optional[float] = None + turboMode: Optional[str] = None + visibleCoreCount: Optional[float] = None + + +class DiskEncryptionKeyRawSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKeyRsaSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class AttachedDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SourceImageEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + + +class SourceSnapshotEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + + +class InitializeParam(BaseModel): + architecture: Optional[str] = None + enableConfidentialCompute: Optional[bool] = None + image: Optional[str] = None + labels: Optional[Dict[str, str]] = None + provisionedIops: Optional[float] = None + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + resourcePolicies: Optional[List[str]] = None + size: Optional[float] = None + snapshot: Optional[str] = None + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItem]] = None + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + storagePool: Optional[str] = None + type: Optional[str] = None + + +class BootDiskItem(BaseModel): + autoDelete: Optional[bool] = None + """ + Default is 6 minutes. + """ + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + guestOsFeatures: Optional[List[str]] = None + initializeParams: Optional[List[InitializeParam]] = None + interface: Optional[str] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class ConfidentialInstanceConfigItem(BaseModel): + confidentialInstanceType: Optional[str] = None + enableConfidentialCompute: Optional[bool] = None + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + type: Optional[str] = None + + +class InstanceEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + networkTier: Optional[str] = None + publicPtrDomainName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + subnetworkRangeName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class Ipv6AccessConfigItem(BaseModel): + externalIpv6: Optional[str] = None + externalIpv6PrefixLength: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkTier: Optional[str] = None + publicPtrDomainName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + ipv6Address: Optional[str] = None + network: Optional[str] = None + networkAttachment: Optional[str] = None + networkIp: Optional[str] = None + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + queueCount: Optional[float] = None + stackType: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkProject: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfigItem(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + + +class Param(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + + +class SpecificReservationItem(BaseModel): + key: Optional[str] = None + values: Optional[List[str]] = None + + +class ReservationAffinityItem(BaseModel): + specificReservation: Optional[List[SpecificReservationItem]] = None + type: Optional[str] = None + + +class LocalSsdRecoveryTimeoutItem(BaseModel): + nanos: Optional[float] = None + seconds: Optional[float] = None + + +class MaxRunDurationItem(BaseModel): + nanos: Optional[float] = None + seconds: Optional[float] = None + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + operator: Optional[str] = None + values: Optional[List[str]] = None + + +class OnInstanceStopActionItem(BaseModel): + discardLocalSsd: Optional[bool] = None + + +class SchedulingItem(BaseModel): + automaticRestart: Optional[bool] = None + availabilityDomain: Optional[float] = None + instanceTerminationAction: Optional[str] = None + localSsdRecoveryTimeout: Optional[List[LocalSsdRecoveryTimeoutItem]] = None + maxRunDuration: Optional[List[MaxRunDurationItem]] = None + minNodeCpus: Optional[float] = None + nodeAffinities: Optional[List[NodeAffinity]] = None + onHostMaintenance: Optional[str] = None + onInstanceStopAction: Optional[List[OnInstanceStopActionItem]] = None + preemptible: Optional[bool] = None + provisioningModel: Optional[str] = None + terminationTime: Optional[str] = None + + +class ScratchDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + interface: Optional[str] = None + size: Optional[float] = None + + +class ServiceAccountItem(BaseModel): + email: Optional[str] = None + scopes: Optional[List[str]] = None + + +class ShieldedInstanceConfigItem(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + enableSecureBoot: Optional[bool] = None + enableVtpm: Optional[bool] = None + + +class SourceInstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceInstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + bootDisk: Optional[List[BootDiskItem]] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[List[InstanceEncryptionKeyItem]] = None + keyRevocationActionType: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + params: Optional[List[Param]] = None + project: Optional[str] = None + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[List[SchedulingItem]] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + serviceAccount: Optional[List[ServiceAccountItem]] = None + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + tags: Optional[List[str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + bootDisk: Optional[List[BootDiskItem]] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[List[InstanceEncryptionKeyItem]] = None + keyRevocationActionType: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + params: Optional[List[Param]] = None + project: Optional[str] = None + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[List[SchedulingItem]] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + serviceAccount: Optional[List[ServiceAccountItem]] = None + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + tags: Optional[List[str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AttachedDiskItemModel(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeySha256: Optional[str] = None + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class SourceImageEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class SourceSnapshotEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class BootDiskItemModel(BaseModel): + autoDelete: Optional[bool] = None + """ + Default is 6 minutes. + """ + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeySha256: Optional[str] = None + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + guestOsFeatures: Optional[List[str]] = None + initializeParams: Optional[List[InitializeParam]] = None + interface: Optional[str] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class InstanceEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + ipv6AccessType: Optional[str] = None + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + network: Optional[str] = None + networkAttachment: Optional[str] = None + networkIp: Optional[str] = None + nicType: Optional[str] = None + queueCount: Optional[float] = None + stackType: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkProject: Optional[str] = None + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItemModel]] = None + bootDisk: Optional[List[BootDiskItemModel]] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + cpuPlatform: Optional[str] = None + creationTimestamp: Optional[str] = None + currentStatus: Optional[str] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + effectiveLabels: Optional[Dict[str, str]] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + id: Optional[str] = None + instanceEncryptionKey: Optional[List[InstanceEncryptionKeyItemModel]] = None + instanceId: Optional[str] = None + keyRevocationActionType: Optional[str] = None + labelFingerprint: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataFingerprint: Optional[str] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + params: Optional[List[Param]] = None + project: Optional[str] = None + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[List[SchedulingItem]] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + selfLink: Optional[str] = None + serviceAccount: Optional[List[ServiceAccountItem]] = None + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + tags: Optional[List[str]] = None + tagsFingerprint: Optional[str] = None + terraformLabels: Optional[Dict[str, str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceFromTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceFromTemplate']] = 'InstanceFromTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceFromTemplateSpec defines the desired state of InstanceFromTemplate + """ + status: Optional[Status] = None + """ + InstanceFromTemplateStatus defines the observed state of InstanceFromTemplate. + """ + + +class InstanceFromTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceFromTemplate] + """ + List of instancefromtemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta2.py new file mode 100644 index 000000000..b447aeea8 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancefromtemplate/v1beta2.py @@ -0,0 +1,865 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_instancefromtemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + enableUefiNetworking: Optional[bool] = None + performanceMonitoringUnit: Optional[str] = None + threadsPerCore: Optional[float] = None + turboMode: Optional[str] = None + visibleCoreCount: Optional[float] = None + + +class DiskEncryptionKeyRawSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKeyRsaSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class AttachedDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + + +class InitializeParams(BaseModel): + architecture: Optional[str] = None + enableConfidentialCompute: Optional[bool] = None + image: Optional[str] = None + labels: Optional[Dict[str, str]] = None + provisionedIops: Optional[float] = None + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + resourcePolicies: Optional[List[str]] = None + size: Optional[float] = None + snapshot: Optional[str] = None + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + storagePool: Optional[str] = None + type: Optional[str] = None + + +class BootDisk(BaseModel): + autoDelete: Optional[bool] = None + """ + Default is 6 minutes. + """ + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + guestOsFeatures: Optional[List[str]] = None + initializeParams: Optional[InitializeParams] = None + interface: Optional[str] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class ConfidentialInstanceConfig(BaseModel): + confidentialInstanceType: Optional[str] = None + enableConfidentialCompute: Optional[bool] = None + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + type: Optional[str] = None + + +class InstanceEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + networkTier: Optional[str] = None + publicPtrDomainName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + subnetworkRangeName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class Ipv6AccessConfigItem(BaseModel): + externalIpv6: Optional[str] = None + externalIpv6PrefixLength: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkTier: Optional[str] = None + publicPtrDomainName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + ipv6Address: Optional[str] = None + network: Optional[str] = None + networkAttachment: Optional[str] = None + networkIp: Optional[str] = None + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + queueCount: Optional[float] = None + stackType: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkProject: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + + +class SpecificReservation(BaseModel): + key: Optional[str] = None + values: Optional[List[str]] = None + + +class ReservationAffinity(BaseModel): + specificReservation: Optional[SpecificReservation] = None + type: Optional[str] = None + + +class LocalSsdRecoveryTimeout(BaseModel): + nanos: Optional[float] = None + seconds: Optional[float] = None + + +class MaxRunDuration(BaseModel): + nanos: Optional[float] = None + seconds: Optional[float] = None + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + operator: Optional[str] = None + values: Optional[List[str]] = None + + +class OnInstanceStopAction(BaseModel): + discardLocalSsd: Optional[bool] = None + + +class Scheduling(BaseModel): + automaticRestart: Optional[bool] = None + availabilityDomain: Optional[float] = None + instanceTerminationAction: Optional[str] = None + localSsdRecoveryTimeout: Optional[LocalSsdRecoveryTimeout] = None + maxRunDuration: Optional[MaxRunDuration] = None + minNodeCpus: Optional[float] = None + nodeAffinities: Optional[List[NodeAffinity]] = None + onHostMaintenance: Optional[str] = None + onInstanceStopAction: Optional[OnInstanceStopAction] = None + preemptible: Optional[bool] = None + provisioningModel: Optional[str] = None + terminationTime: Optional[str] = None + + +class ScratchDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + interface: Optional[str] = None + size: Optional[float] = None + + +class ServiceAccount(BaseModel): + email: Optional[str] = None + scopes: Optional[List[str]] = None + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + enableSecureBoot: Optional[bool] = None + enableVtpm: Optional[bool] = None + + +class SourceInstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceInstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + bootDisk: Optional[BootDisk] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + keyRevocationActionType: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + params: Optional[Params] = None + project: Optional[str] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[Scheduling] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + serviceAccount: Optional[ServiceAccount] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + tags: Optional[List[str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + bootDisk: Optional[BootDisk] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + keyRevocationActionType: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + params: Optional[Params] = None + project: Optional[str] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[Scheduling] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + serviceAccount: Optional[ServiceAccount] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + tags: Optional[List[str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AttachedDiskItemModel(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeySha256: Optional[str] = None + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class BootDiskModel(BaseModel): + autoDelete: Optional[bool] = None + """ + Default is 6 minutes. + """ + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeySha256: Optional[str] = None + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + guestOsFeatures: Optional[List[str]] = None + initializeParams: Optional[InitializeParams] = None + interface: Optional[str] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class InstanceEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + ipv6AccessType: Optional[str] = None + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + network: Optional[str] = None + networkAttachment: Optional[str] = None + networkIp: Optional[str] = None + nicType: Optional[str] = None + queueCount: Optional[float] = None + stackType: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkProject: Optional[str] = None + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItemModel]] = None + bootDisk: Optional[BootDiskModel] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + cpuPlatform: Optional[str] = None + creationTimestamp: Optional[str] = None + currentStatus: Optional[str] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + effectiveLabels: Optional[Dict[str, str]] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + id: Optional[str] = None + instanceEncryptionKey: Optional[InstanceEncryptionKeyModel] = None + instanceId: Optional[str] = None + keyRevocationActionType: Optional[str] = None + labelFingerprint: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataFingerprint: Optional[str] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + params: Optional[Params] = None + project: Optional[str] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[Scheduling] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + selfLink: Optional[str] = None + serviceAccount: Optional[ServiceAccount] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + tags: Optional[List[str]] = None + tagsFingerprint: Optional[str] = None + terraformLabels: Optional[Dict[str, str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceFromTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['InstanceFromTemplate']] = 'InstanceFromTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceFromTemplateSpec defines the desired state of InstanceFromTemplate + """ + status: Optional[Status] = None + """ + InstanceFromTemplateStatus defines the observed state of InstanceFromTemplate. + """ + + +class InstanceFromTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceFromTemplate] + """ + List of instancefromtemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancegroup/__init__.py b/schemas/python/models/io/upbound/gcp/compute/instancegroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/instancegroup/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/instancegroup/v1beta1.py new file mode 100644 index 000000000..940bfe1e9 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancegroup/v1beta1.py @@ -0,0 +1,404 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_instancegroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstancesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstancesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name which the port will be mapped to. + """ + port: Optional[float] = None + """ + The port number to map the name to. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional textual description of the instance + group. + """ + instances: Optional[List[str]] = None + """ + The list of instances in the group, in self_link format. + When adding instances they must all be in the same network and zone as the instance group. + """ + instancesRefs: Optional[List[InstancesRef]] = None + """ + References to Instance in compute to populate instances. + """ + instancesSelector: Optional[InstancesSelector] = None + """ + Selector for a list of Instance in compute to populate instances. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network the instance group is in. If + this is different from the network where the instances are in, the creation + fails. Defaults to the network where the instances are in (if neither + network nor instances is specified, this field will be blank). + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + zone: str + """ + The zone that this instance group should be created in. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional textual description of the instance + group. + """ + instances: Optional[List[str]] = None + """ + The list of instances in the group, in self_link format. + When adding instances they must all be in the same network and zone as the instance group. + """ + instancesRefs: Optional[List[InstancesRef]] = None + """ + References to Instance in compute to populate instances. + """ + instancesSelector: Optional[InstancesSelector] = None + """ + Selector for a list of Instance in compute to populate instances. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network the instance group is in. If + this is different from the network where the instances are in, the creation + fails. Defaults to the network where the instances are in (if neither + network nor instances is specified, this field will be blank). + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional textual description of the instance + group. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}/zones/{{zone}}/instanceGroups/{{name}} + """ + instances: Optional[List[str]] = None + """ + The list of instances in the group, in self_link format. + When adding instances they must all be in the same network and zone as the instance group. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network the instance group is in. If + this is different from the network where the instances are in, the creation + fails. Defaults to the network where the instances are in (if neither + network nor instances is specified, this field will be blank). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + The number of instances in the group. + """ + zone: Optional[str] = None + """ + The zone that this instance group should be created in. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceGroup']] = 'InstanceGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceGroupSpec defines the desired state of InstanceGroup + """ + status: Optional[Status] = None + """ + InstanceGroupStatus defines the observed state of InstanceGroup. + """ + + +class InstanceGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceGroup] + """ + List of instancegroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/__init__.py b/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta1.py new file mode 100644 index 000000000..157c1e397 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta1.py @@ -0,0 +1,961 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_instancegroupmanager.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AllInstancesConfigItem(BaseModel): + labels: Optional[Dict[str, str]] = None + """ + , The label key-value pairs that you want to patch onto the instance. + """ + metadata: Optional[Dict[str, str]] = None + """ + , The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthCheckRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthCheckSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AutoHealingPolicy(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + healthCheckRef: Optional[HealthCheckRef] = None + """ + Reference to a HealthCheck in compute to populate healthCheck. + """ + healthCheckSelector: Optional[HealthCheckSelector] = None + """ + Selector for a HealthCheck in compute to populate healthCheck. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class InstanceLifecyclePolicyItem(BaseModel): + defaultActionOnFailure: Optional[str] = None + """ + , Default behavior for all instance or health check failures. Valid options are: REPAIR, DO_NOTHING. If DO_NOTHING then instances will not be repaired. If REPAIR (default), then failed instances will be repaired. + """ + forceUpdateOnRepair: Optional[str] = None + """ + ), Specifies whether to apply the group's latest configuration when repairing a VM. Valid options are: YES, NO. If YES and you updated the group's instance template or per-instance configurations after the VM was created, then these changes are applied when VM is repaired. If NO (default), then updates are applied in accordance with the group's update policy type. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name which the port will be mapped to. + """ + port: Optional[float] = None + """ + The port number to map the name to. + """ + + +class WorkloadPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WorkloadPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ResourcePolicy(BaseModel): + workloadPolicy: Optional[str] = None + """ + The URL of the workload policy that is specified for this managed instance group. It can be a full or partial URL. + """ + workloadPolicyRef: Optional[WorkloadPolicyRef] = None + """ + Reference to a ResourcePolicy in compute to populate workloadPolicy. + """ + workloadPolicySelector: Optional[WorkloadPolicySelector] = None + """ + Selector for a ResourcePolicy in compute to populate workloadPolicy. + """ + + +class StandbyPolicyItem(BaseModel): + initialDelaySec: Optional[float] = None + """ + - Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + """ + mode: Optional[str] = None + """ + - Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. Valid options are: MANUAL, SCALE_OUT_POOL. If MANUAL(default), you have full control over which VMs are stopped and suspended in the MIG. If SCALE_OUT_POOL, the MIG uses the VMs from the standby pools to accelerate the scale out by resuming or starting them and then automatically replenishes the standby pool with new VMs to maintain the target sizes. + """ + + +class StatefulDiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the disk when the VM is deleted, but do not delete the disk. ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently deleted from the instance group. The default is NEVER. + """ + deviceName: Optional[str] = None + """ + , The device name of the disk to be attached. + """ + + +class StatefulExternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the external ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the external ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the external Ip. Possible value: nic0 + """ + + +class StatefulInternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the internal ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the internal ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the internal Ip. Possible value: nic0 + """ + + +class TargetPoolsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetPoolsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UpdatePolicyItem(BaseModel): + maxSurgeFixed: Optional[float] = None + """ + , The maximum number of instances that can be created above the specified targetSize during the update process. Conflicts with max_surge_percent. If neither is set, defaults to 1 + """ + maxSurgePercent: Optional[float] = None + """ + , The maximum number of instances(calculated as percentage) that can be created above the specified targetSize during the update process. Conflicts with max_surge_fixed. + """ + maxUnavailableFixed: Optional[float] = None + """ + , The maximum number of instances that can be unavailable during the update process. Conflicts with max_unavailable_percent. If neither is set, defaults to 1 + """ + maxUnavailablePercent: Optional[float] = None + """ + , The maximum number of instances(calculated as percentage) that can be unavailable during the update process. Conflicts with max_unavailable_fixed. + """ + minimalAction: Optional[str] = None + """ + - Minimal action to be taken on an instance. You can specify either REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + """ + replacementMethod: Optional[str] = None + """ + , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved. You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0. + """ + type: Optional[str] = None + """ + - The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + """ + + +class InstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetSizeItem(BaseModel): + fixed: Optional[float] = None + """ + , The number of instances which are managed for this version. Conflicts with percent. + """ + percent: Optional[float] = None + """ + , The number of instances (calculated as percentage) which are managed for this version. Conflicts with fixed. + Note that when using percent, rounding will be in favor of explicitly set target_size values; a managed instance group with 2 instances and 2 versions, + one of which has a target_size.percent of 60 will create 2 instances of that version. + """ + + +class VersionItem(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. It is recommended to reference instance templates through their unique id (self_link_unique attribute). + """ + instanceTemplateRef: Optional[InstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate instanceTemplate. + """ + instanceTemplateSelector: Optional[InstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate instanceTemplate. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[List[TargetSizeItem]] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class ForProvider(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[List[AutoHealingPolicy]] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + instanceLifecyclePolicy: Optional[List[InstanceLifecyclePolicyItem]] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[List[ResourcePolicy]] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + standbyPolicy: Optional[List[StandbyPolicyItem]] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[List[UpdatePolicyItem]] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + zone: str + """ + The zone that instances in this group should be created + in. + """ + + +class InitProvider(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[List[AutoHealingPolicy]] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + instanceLifecyclePolicy: Optional[List[InstanceLifecyclePolicyItem]] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[List[ResourcePolicy]] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + standbyPolicy: Optional[List[StandbyPolicyItem]] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[List[UpdatePolicyItem]] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AutoHealingPolicyModel(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class ResourcePolicyModel(BaseModel): + workloadPolicy: Optional[str] = None + """ + The URL of the workload policy that is specified for this managed instance group. It can be a full or partial URL. + """ + + +class AllInstancesConfigItemModel(BaseModel): + currentRevision: Optional[str] = None + """ + Current all-instances configuration revision. This value is in RFC3339 text format. + """ + effective: Optional[bool] = None + + +class PerInstanceConfig(BaseModel): + allEffective: Optional[bool] = None + """ + A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + """ + + +class StatefulItem(BaseModel): + hasStatefulConfig: Optional[bool] = None + """ + A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + """ + perInstanceConfigs: Optional[List[PerInstanceConfig]] = None + """ + Status of per-instance configs on the instance. + """ + + +class VersionTargetItem(BaseModel): + isReached: Optional[bool] = None + + +class StatusItem(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItemModel]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + isStable: Optional[bool] = None + """ + A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + """ + stateful: Optional[List[StatefulItem]] = None + """ + Stateful status of the given Instance Group Manager. + """ + versionTarget: Optional[List[VersionTargetItem]] = None + """ + A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + """ + + +class VersionItemModel(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. It is recommended to reference instance templates through their unique id (self_link_unique attribute). + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[List[TargetSizeItem]] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class AtProvider(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[List[AutoHealingPolicyModel]] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + fingerprint: Optional[str] = None + """ + The fingerprint of the instance group manager. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}} + """ + instanceGroup: Optional[str] = None + """ + The full URL of the instance group created by the manager. + """ + instanceGroupManagerId: Optional[float] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}} + """ + instanceLifecyclePolicy: Optional[List[InstanceLifecyclePolicyItem]] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + operation: Optional[str] = None + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[List[ResourcePolicyModel]] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URL of the created resource. + """ + standbyPolicy: Optional[List[StandbyPolicyItem]] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + status: Optional[List[StatusItem]] = None + """ + The status of this managed instance group. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[List[UpdatePolicyItem]] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItemModel]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + zone: Optional[str] = None + """ + The zone that instances in this group should be created + in. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceGroupManager(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceGroupManager']] = 'InstanceGroupManager' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceGroupManagerSpec defines the desired state of InstanceGroupManager + """ + status: Optional[Status] = None + """ + InstanceGroupManagerStatus defines the observed state of InstanceGroupManager. + """ + + +class InstanceGroupManagerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceGroupManager] + """ + List of instancegroupmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta2.py new file mode 100644 index 000000000..bc29f44db --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancegroupmanager/v1beta2.py @@ -0,0 +1,962 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_instancegroupmanager.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AllInstancesConfig(BaseModel): + labels: Optional[Dict[str, str]] = None + """ + , The label key-value pairs that you want to patch onto the instance. + """ + metadata: Optional[Dict[str, str]] = None + """ + , The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthCheckRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthCheckSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AutoHealingPolicies(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + healthCheckRef: Optional[HealthCheckRef] = None + """ + Reference to a HealthCheck in compute to populate healthCheck. + """ + healthCheckSelector: Optional[HealthCheckSelector] = None + """ + Selector for a HealthCheck in compute to populate healthCheck. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class InstanceLifecyclePolicy(BaseModel): + defaultActionOnFailure: Optional[str] = None + """ + , Specifies the action that a MIG performs on a failed VM. If the value of the on_failed_health_check field is DEFAULT_ACTION, then the same action also applies to the VMs on which your application fails a health check. Valid options are: DO_NOTHING, REPAIR. If DO_NOTHING, then MIG does not repair a failed VM. If REPAIR (default), then MIG automatically repairs a failed VM by recreating it. For more information, see about repairing VMs in a MIG. + """ + forceUpdateOnRepair: Optional[str] = None + """ + , Specifies whether to apply the group's latest configuration when repairing a VM. Valid options are: YES, NO. If YES and you updated the group's instance template or per-instance configurations after the VM was created, then these changes are applied when VM is repaired. If NO (default), then updates are applied in accordance with the group's update policy type. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name of the port. + """ + port: Optional[float] = None + """ + The port number. + """ + + +class WorkloadPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WorkloadPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ResourcePolicies(BaseModel): + workloadPolicy: Optional[str] = None + """ + The URL of the workload policy that is specified for this managed instance group. It can be a full or partial URL. + """ + workloadPolicyRef: Optional[WorkloadPolicyRef] = None + """ + Reference to a ResourcePolicy in compute to populate workloadPolicy. + """ + workloadPolicySelector: Optional[WorkloadPolicySelector] = None + """ + Selector for a ResourcePolicy in compute to populate workloadPolicy. + """ + + +class StandbyPolicy(BaseModel): + initialDelaySec: Optional[float] = None + """ + - Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + """ + mode: Optional[str] = None + """ + - Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. Valid options are: MANUAL, SCALE_OUT_POOL. If MANUAL(default), you have full control over which VMs are stopped and suspended in the MIG. If SCALE_OUT_POOL, the MIG uses the VMs from the standby pools to accelerate the scale out by resuming or starting them and then automatically replenishes the standby pool with new VMs to maintain the target sizes. + """ + + +class StatefulDiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the disk when the VM is deleted, but do not delete the disk. ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently deleted from the instance group. The default is NEVER. + """ + deviceName: Optional[str] = None + """ + , The device name of the disk to be attached. + """ + + +class StatefulExternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the external ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the external ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the external Ip. Possible value: nic0 + """ + + +class StatefulInternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the internal ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the internal ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the internal Ip. Possible value: nic0 + """ + + +class TargetPoolsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetPoolsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UpdatePolicy(BaseModel): + maxSurgeFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. Conflicts with max_surge_percent. Both cannot be 0. + """ + maxSurgePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. Conflicts with max_surge_fixed. + """ + maxUnavailableFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. + """ + maxUnavailablePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.. + """ + minimalAction: Optional[str] = None + """ + - Minimal action to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + """ + replacementMethod: Optional[str] = None + """ + , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved. You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0. + """ + type: Optional[str] = None + """ + - The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + """ + + +class InstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetSize(BaseModel): + fixed: Optional[float] = None + """ + , The number of instances which are managed for this version. Conflicts with percent. + """ + percent: Optional[float] = None + """ + , The number of instances (calculated as percentage) which are managed for this version. Conflicts with fixed. + Note that when using percent, rounding will be in favor of explicitly set target_size values; a managed instance group with 2 instances and 2 versions, + one of which has a target_size.percent of 60 will create 2 instances of that version. + """ + + +class VersionItem(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. It is recommended to reference instance templates through their unique id (self_link_unique attribute). + """ + instanceTemplateRef: Optional[InstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate instanceTemplate. + """ + instanceTemplateSelector: Optional[InstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate instanceTemplate. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class ForProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[ResourcePolicies] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + zone: str + """ + The zone that instances in this group should be created + in. + """ + + +class InitProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[ResourcePolicies] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AutoHealingPoliciesModel(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class ResourcePoliciesModel(BaseModel): + workloadPolicy: Optional[str] = None + """ + The URL of the workload policy that is specified for this managed instance group. It can be a full or partial URL. + """ + + +class AllInstancesConfigItem(BaseModel): + currentRevision: Optional[str] = None + """ + Current all-instances configuration revision. This value is in RFC3339 text format. + """ + effective: Optional[bool] = None + """ + A bit indicating whether this configuration has been applied to all managed instances in the group. + """ + + +class PerInstanceConfig(BaseModel): + allEffective: Optional[bool] = None + """ + A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + """ + + +class StatefulItem(BaseModel): + hasStatefulConfig: Optional[bool] = None + """ + A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + """ + perInstanceConfigs: Optional[List[PerInstanceConfig]] = None + """ + Status of per-instance configs on the instances. + """ + + +class VersionTargetItem(BaseModel): + isReached: Optional[bool] = None + + +class StatusItem(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Status of all-instances configuration on the group. + """ + isStable: Optional[bool] = None + """ + A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + """ + stateful: Optional[List[StatefulItem]] = None + """ + Stateful status of the given Instance Group Manager. + """ + versionTarget: Optional[List[VersionTargetItem]] = None + """ + A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + """ + + +class VersionItemModel(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. It is recommended to reference instance templates through their unique id (self_link_unique attribute). + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class AtProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPoliciesModel] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + fingerprint: Optional[str] = None + """ + The fingerprint of the instance group manager. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}} + """ + instanceGroup: Optional[str] = None + """ + The full URL of the instance group created by the manager. + """ + instanceGroupManagerId: Optional[float] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}} + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + operation: Optional[str] = None + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[ResourcePoliciesModel] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URL of the created resource. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + status: Optional[List[StatusItem]] = None + """ + The status of this managed instance group. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItemModel]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + zone: Optional[str] = None + """ + The zone that instances in this group should be created + in. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceGroupManager(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['InstanceGroupManager']] = 'InstanceGroupManager' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceGroupManagerSpec defines the desired state of InstanceGroupManager + """ + status: Optional[Status] = None + """ + InstanceGroupManagerStatus defines the observed state of InstanceGroupManager. + """ + + +class InstanceGroupManagerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceGroupManager] + """ + List of instancegroupmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancegroupnamedport/__init__.py b/schemas/python/models/io/upbound/gcp/compute/instancegroupnamedport/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/instancegroupnamedport/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/instancegroupnamedport/v1beta1.py new file mode 100644 index 000000000..3ab87b3aa --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancegroupnamedport/v1beta1.py @@ -0,0 +1,276 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_instancegroupnamedport.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + group: Optional[str] = None + """ + The name of the instance group. + """ + name: Optional[str] = None + """ + The name for this named port. The name must be 1-63 characters + long, and comply with RFC1035. + """ + port: Optional[float] = None + """ + The port number, which can be a value between 1 and 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + The zone of the instance group. + """ + + +class InitProvider(BaseModel): + group: Optional[str] = None + """ + The name of the instance group. + """ + name: Optional[str] = None + """ + The name for this named port. The name must be 1-63 characters + long, and comply with RFC1035. + """ + port: Optional[float] = None + """ + The port number, which can be a value between 1 and 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + The zone of the instance group. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + group: Optional[str] = None + """ + The name of the instance group. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroups/{{group}}/{{port}}/{{name}} + """ + name: Optional[str] = None + """ + The name for this named port. The name must be 1-63 characters + long, and comply with RFC1035. + """ + port: Optional[float] = None + """ + The port number, which can be a value between 1 and 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + The zone of the instance group. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceGroupNamedPort(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceGroupNamedPort']] = 'InstanceGroupNamedPort' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceGroupNamedPortSpec defines the desired state of InstanceGroupNamedPort + """ + status: Optional[Status] = None + """ + InstanceGroupNamedPortStatus defines the observed state of InstanceGroupNamedPort. + """ + + +class InstanceGroupNamedPortList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceGroupNamedPort] + """ + List of instancegroupnamedports. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instanceiammember/__init__.py b/schemas/python/models/io/upbound/gcp/compute/instanceiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta1.py new file mode 100644 index 000000000..62a4e35a7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta1.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_instanceiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + instanceName: Optional[str] = None + instanceNameRef: Optional[InstanceNameRef] = None + """ + Reference to a Instance in compute to populate instanceName. + """ + instanceNameSelector: Optional[InstanceNameSelector] = None + """ + Selector for a Instance in compute to populate instanceName. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + instanceName: Optional[str] = None + instanceNameRef: Optional[InstanceNameRef] = None + """ + Reference to a Instance in compute to populate instanceName. + """ + instanceNameSelector: Optional[InstanceNameSelector] = None + """ + Selector for a Instance in compute to populate instanceName. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + instanceName: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceIAMMember']] = 'InstanceIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceIAMMemberSpec defines the desired state of InstanceIAMMember + """ + status: Optional[Status] = None + """ + InstanceIAMMemberStatus defines the observed state of InstanceIAMMember. + """ + + +class InstanceIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceIAMMember] + """ + List of instanceiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta2.py new file mode 100644 index 000000000..bca11cfa7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instanceiammember/v1beta2.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_instanceiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + instanceName: Optional[str] = None + instanceNameRef: Optional[InstanceNameRef] = None + """ + Reference to a Instance in compute to populate instanceName. + """ + instanceNameSelector: Optional[InstanceNameSelector] = None + """ + Selector for a Instance in compute to populate instanceName. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + instanceName: Optional[str] = None + instanceNameRef: Optional[InstanceNameRef] = None + """ + Reference to a Instance in compute to populate instanceName. + """ + instanceNameSelector: Optional[InstanceNameSelector] = None + """ + Selector for a Instance in compute to populate instanceName. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + instanceName: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['InstanceIAMMember']] = 'InstanceIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceIAMMemberSpec defines the desired state of InstanceIAMMember + """ + status: Optional[Status] = None + """ + InstanceIAMMemberStatus defines the observed state of InstanceIAMMember. + """ + + +class InstanceIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceIAMMember] + """ + List of instanceiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancetemplate/__init__.py b/schemas/python/models/io/upbound/gcp/compute/instancetemplate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta1.py new file mode 100644 index 000000000..a424fa17a --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta1.py @@ -0,0 +1,1600 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_instancetemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeature(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + enableUefiNetworking: Optional[bool] = None + """ + Whether to enable UEFI networking for instance creation. + """ + performanceMonitoringUnit: Optional[str] = None + """ + The PMU is a hardware component within the CPU core that monitors how the processor runs code. Valid values for the level of PMU are STANDARD, ENHANCED, and ARCHITECTURAL. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + """ + turboMode: Optional[str] = None + """ + Turbo frequency mode to use for the instance. Supported modes are currently either ALL_CORE_MAX or unset (default). + """ + visibleCoreCount: Optional[float] = None + """ + The number of physical cores to expose to an instance. visible cores info (VC). + """ + + +class ConfidentialInstanceConfigItem(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the confidential computing technology the instance uses. SEV is an AMD feature. TDX is an Intel feature. One of the following values is required: SEV, SEV_SNP, TDX. on_host_maintenance can be set to MIGRATE if confidential_instance_type is set to SEV and min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. If SEV_SNP, currently min_cpu_platform has to be set to "AMD Milan" or this will fail to create the VM. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Defines whether the instance should have confidential compute enabled with AMD SEV. If enabled, on_host_maintenance can be set to MIGRATE if min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. + """ + + +class DiskEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ResourcePoliciesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ResourcePoliciesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SourceImageEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceSnapshotEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class DiskItem(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + autoDelete: Optional[bool] = None + """ + Whether or not the disk should be auto-deleted. + This defaults to true. + """ + boot: Optional[bool] = None + """ + Indicates that this is a boot disk. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the + /dev/ tree of a Linux operating system running within the instance. If not + specified, the server chooses a default device name to apply to this disk. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItem]] = None + """ + Encrypts or decrypts a disk using a customer-supplied encryption key. + """ + diskName: Optional[str] = None + """ + Name of the disk. When not provided, this defaults + to the name of the instance. + """ + diskSizeGb: Optional[float] = None + """ + The size of the image in gigabytes. If not + specified, it will inherit the size of its base image. For SCRATCH disks, + the size must be exactly 375GB. + """ + diskType: Optional[str] = None + """ + The GCE disk type. Such as "pd-ssd", "local-ssd", + "pd-balanced" or "pd-standard", "hyperdisk-balanced", "hyperdisk-throughput" or "hyperdisk-extreme". + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + interface: Optional[str] = None + """ + Specifies the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + and the request will fail if you attempt to attach a persistent disk in any other format + than SCSI. Local SSDs can use either NVME or SCSI. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of ket/value label pairs to assign to disk created from + this template + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If you are attaching or creating a boot disk, this must + read-write mode. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This + sets the number of I/O operations per second that the disk can handle. + Values must be between 10,000 and 120,000. For more details, see the + Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to this disk. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + """ + resourcePoliciesRefs: Optional[List[ResourcePoliciesRef]] = None + """ + References to ResourcePolicy in compute to populate resourcePolicies. + """ + resourcePoliciesSelector: Optional[ResourcePoliciesSelector] = None + """ + Selector for a list of ResourcePolicy in compute to populate resourcePolicies. + """ + source: Optional[str] = None + """ + The name (not self_link) + of the disk (such as those managed by google_compute_disk) to attach. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImage: Optional[str] = None + """ + The image from which to + initialize this disk. This can be one of: the image's self_link, + projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItem]] = None + """ + The customer-supplied encryption + key of the source image. Required if the source image is protected by a + customer-supplied encryption key. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + sourceSnapshot: Optional[str] = None + """ + The source snapshot to create this disk. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + The customer-supplied encryption + key of the source snapshot. Structure + documented below. + """ + type: Optional[str] = None + """ + The type of GCE disk, can be either "SCRATCH" or + "PERSISTENT". + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + """ + The IP address that will be 1:1 mapped to the instance's + network ip. If not given, one will be generated. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The IP CIDR range represented by this alias IP range. This IP CIDR range + must belong to the specified subnetwork and cannot contain IP addresses reserved by + system or used by other network interfaces. At the time of writing only a + netmask (e.g. /24) may be supplied, with a CIDR format resulting in an API + error. + """ + subnetworkRangeName: Optional[str] = None + """ + The subnetwork secondary range name specifying + the secondary range from which to allocate the IP CIDR range for this alias IP + range. If left unspecified, the primary range of the subnetwork will be used. + """ + + +class Ipv6AccessConfigItem(BaseModel): + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet.g. via tunnel or because it is running on another cloud instance + on that network). This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6Address: Optional[str] = None + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Use network attribute for Legacy or Auto subnetted networks and + subnetwork for custom subnetted networks. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + the name of the subnetwork to attach this interface + to. The subnetwork must exist in the same region this instance will be + created in. Either network or subnetwork must be provided. + """ + subnetworkProject: Optional[str] = None + """ + The ID of the project in which the subnetwork belongs. + If it is not provided, the provider project is used. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfigItem(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + The egress bandwidth tier to enable. Possible values: TIER_1, DEFAULT + """ + + +class SpecificReservationItem(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class ReservationAffinityItem(BaseModel): + specificReservation: Optional[List[SpecificReservationItem]] = None + """ + Specifies the label selector for the reservation to use.. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class LocalSsdRecoveryTimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class MaxRunDurationItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + operator: Optional[str] = None + """ + The operator. Can be IN for node-affinities + or NOT_IN for anti-affinities. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class OnInstanceStopActionItem(BaseModel): + discardLocalSsd: Optional[bool] = None + """ + Whether to discard local SSDs attached to the VM while terminating using max_run_duration. Only supports true at this point. + """ + + +class SchedulingItem(BaseModel): + automaticRestart: Optional[bool] = None + """ + Specifies whether the instance should be + automatically restarted if it is terminated by Compute Engine (not + terminated by a user). This defaults to true. + """ + availabilityDomain: Optional[float] = None + """ + Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + """ + instanceTerminationAction: Optional[str] = None + """ + Describe the type of termination action for SPOT VM. Can be STOP or DELETE. Read more on here + """ + localSsdRecoveryTimeout: Optional[List[LocalSsdRecoveryTimeoutItem]] = None + """ + io/docs/providers/google/guides/provider_versions.html) Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. Structure is documented below. + """ + maxRunDuration: Optional[List[MaxRunDurationItem]] = None + """ + The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in instance_termination_action. Structure is documented below. + """ + minNodeCpus: Optional[float] = None + nodeAffinities: Optional[List[NodeAffinity]] = None + """ + Specifies node affinities or anti-affinities + to determine which sole-tenant nodes your instances and managed instance + groups will use as host systems. Read more on sole-tenant node creation + here. + Structure documented below. + """ + onHostMaintenance: Optional[str] = None + """ + Defines the maintenance behavior for this + instance. + """ + onInstanceStopAction: Optional[List[OnInstanceStopActionItem]] = None + """ + Specifies the action to be performed when the instance is terminated using max_run_duration and STOP instance_termination_action. Only support true discard_local_ssd at this point. Structure is documented below. + """ + preemptible: Optional[bool] = None + """ + Allows instance to be preempted. This defaults to + false. Read more on this + here. + """ + provisioningModel: Optional[str] = None + """ + Describe the type of preemptible VM. This field accepts the value STANDARD or SPOT. If the value is STANDARD, there will be no discount. If this is set to SPOT, + preemptible should be true and automatic_restart should be + false. For more info about + SPOT, read here + """ + terminationTime: Optional[str] = None + """ + Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + """ + + +class EmailRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EmailSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceAccountItem(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. If not given, the + default Google Compute Engine service account is used. + """ + emailRef: Optional[EmailRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate email. + """ + emailSelector: Optional[EmailSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate email. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + """ + + +class ShieldedInstanceConfigItem(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + - Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. + """ + enableSecureBoot: Optional[bool] = None + """ + - Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. + """ + enableVtpm: Optional[bool] = None + """ + - Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItem]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[List[SchedulingItem]] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + serviceAccount: Optional[List[ServiceAccountItem]] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItem]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[List[SchedulingItem]] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + serviceAccount: Optional[List[ServiceAccountItem]] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SourceImageEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class SourceSnapshotEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class DiskItemModel(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + autoDelete: Optional[bool] = None + """ + Whether or not the disk should be auto-deleted. + This defaults to true. + """ + boot: Optional[bool] = None + """ + Indicates that this is a boot disk. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the + /dev/ tree of a Linux operating system running within the instance. If not + specified, the server chooses a default device name to apply to this disk. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItem]] = None + """ + Encrypts or decrypts a disk using a customer-supplied encryption key. + """ + diskName: Optional[str] = None + """ + Name of the disk. When not provided, this defaults + to the name of the instance. + """ + diskSizeGb: Optional[float] = None + """ + The size of the image in gigabytes. If not + specified, it will inherit the size of its base image. For SCRATCH disks, + the size must be exactly 375GB. + """ + diskType: Optional[str] = None + """ + The GCE disk type. Such as "pd-ssd", "local-ssd", + "pd-balanced" or "pd-standard", "hyperdisk-balanced", "hyperdisk-throughput" or "hyperdisk-extreme". + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + interface: Optional[str] = None + """ + Specifies the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + and the request will fail if you attempt to attach a persistent disk in any other format + than SCSI. Local SSDs can use either NVME or SCSI. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of ket/value label pairs to assign to disk created from + this template + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If you are attaching or creating a boot disk, this must + read-write mode. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This + sets the number of I/O operations per second that the disk can handle. + Values must be between 10,000 and 120,000. For more details, see the + Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to this disk. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + """ + source: Optional[str] = None + """ + The name (not self_link) + of the disk (such as those managed by google_compute_disk) to attach. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImage: Optional[str] = None + """ + The image from which to + initialize this disk. This can be one of: the image's self_link, + projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImageEncryptionKey: Optional[List[SourceImageEncryptionKeyItemModel]] = None + """ + The customer-supplied encryption + key of the source image. Required if the source image is protected by a + customer-supplied encryption key. + """ + sourceSnapshot: Optional[str] = None + """ + The source snapshot to create this disk. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceSnapshotEncryptionKey: Optional[ + List[SourceSnapshotEncryptionKeyItemModel] + ] = None + """ + The customer-supplied encryption + key of the source snapshot. Structure + documented below. + """ + type: Optional[str] = None + """ + The type of GCE disk, can be either "SCRATCH" or + "PERSISTENT". + """ + + +class AccessConfigItemModel(BaseModel): + natIp: Optional[str] = None + """ + The IP address that will be 1:1 mapped to the instance's + network ip. If not given, one will be generated. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The name of the instance template. + """ + + +class Ipv6AccessConfigItemModel(BaseModel): + externalIpv6: Optional[str] = None + externalIpv6PrefixLength: Optional[str] = None + name: Optional[str] = None + """ + The name of the instance template. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The name of the instance template. + """ + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItemModel]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet.g. via tunnel or because it is running on another cloud instance + on that network). This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItemModel]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6AccessType: Optional[str] = None + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + The name of the instance template. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Use network attribute for Legacy or Auto subnetted networks and + subnetwork for custom subnetted networks. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + the name of the subnetwork to attach this interface + to. The subnetwork must exist in the same region this instance will be + created in. Either network or subnetwork must be provided. + """ + subnetworkProject: Optional[str] = None + """ + The ID of the project in which the subnetwork belongs. + If it is not provided, the provider project is used. + """ + + +class ServiceAccountItemModel(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. If not given, the + default Google Compute Engine service account is used. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + """ + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[List[ConfidentialInstanceConfigItem]] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItemModel]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + effectiveLabels: Optional[Dict[str, str]] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/instanceTemplates/{{name}} + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataFingerprint: Optional[str] = None + """ + The unique fingerprint of the metadata. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + numericId: Optional[str] = None + """ + numeric identifier of the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[List[SchedulingItem]] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + selfLinkUnique: Optional[str] = None + """ + A special URI of the created resource that uniquely identifies this instance template with the following format: projects/{{project}}/global/instanceTemplates/{{name}}?uniqueId={{uniqueId}} + Referencing an instance template via this attribute prevents Time of Check to Time of Use attacks when the instance template resides in a shared/untrusted environment. + """ + serviceAccount: Optional[List[ServiceAccountItemModel]] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + tagsFingerprint: Optional[str] = None + """ + The unique fingerprint of the tags. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceTemplate']] = 'InstanceTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceTemplateSpec defines the desired state of InstanceTemplate + """ + status: Optional[Status] = None + """ + InstanceTemplateStatus defines the observed state of InstanceTemplate. + """ + + +class InstanceTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceTemplate] + """ + List of instancetemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta2.py new file mode 100644 index 000000000..e9d547b5e --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/instancetemplate/v1beta2.py @@ -0,0 +1,1598 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_instancetemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + enableUefiNetworking: Optional[bool] = None + """ + Whether to enable UEFI networking for instance creation. + """ + performanceMonitoringUnit: Optional[str] = None + """ + The PMU is a hardware component within the CPU core that monitors how the processor runs code. Valid values for the level of PMU are STANDARD, ENHANCED, and ARCHITECTURAL. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + """ + turboMode: Optional[str] = None + """ + Turbo frequency mode to use for the instance. Supported modes are currently either ALL_CORE_MAX or unset (default). + """ + visibleCoreCount: Optional[float] = None + """ + The number of physical cores to expose to an instance. visible cores info (VC). + """ + + +class ConfidentialInstanceConfig(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the confidential computing technology the instance uses. SEV is an AMD feature. TDX is an Intel feature. One of the following values is required: SEV, SEV_SNP, TDX. on_host_maintenance can be set to MIGRATE if confidential_instance_type is set to SEV and min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. If SEV_SNP, currently min_cpu_platform has to be set to "AMD Milan" or this will fail to create the VM. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Defines whether the instance should have confidential compute enabled with AMD SEV. If enabled, on_host_maintenance can be set to MIGRATE if min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. + """ + + +class DiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ResourcePoliciesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ResourcePoliciesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class DiskItem(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + autoDelete: Optional[bool] = None + """ + Whether or not the disk should be auto-deleted. + This defaults to true. + """ + boot: Optional[bool] = None + """ + Indicates that this is a boot disk. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the + /dev/ tree of a Linux operating system running within the instance. If not + specified, the server chooses a default device name to apply to this disk. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts or decrypts a disk using a customer-supplied encryption key. + """ + diskName: Optional[str] = None + """ + Name of the disk. When not provided, this defaults + to the name of the instance. + """ + diskSizeGb: Optional[float] = None + """ + The size of the image in gigabytes. If not + specified, it will inherit the size of its base image. For SCRATCH disks, + the size must be exactly 375GB. + """ + diskType: Optional[str] = None + """ + The GCE disk type. Such as "pd-ssd", "local-ssd", + "pd-balanced" or "pd-standard", "hyperdisk-balanced", "hyperdisk-throughput" or "hyperdisk-extreme". + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + interface: Optional[str] = None + """ + Specifies the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + and the request will fail if you attempt to attach a persistent disk in any other format + than SCSI. Local SSDs can use either NVME or SCSI. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of ket/value label pairs to assign to disk created from + this template + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If you are attaching or creating a boot disk, this must + read-write mode. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This + sets the number of I/O operations per second that the disk can handle. + Values must be between 10,000 and 120,000. For more details, see the + Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to this disk. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + """ + resourcePoliciesRefs: Optional[List[ResourcePoliciesRef]] = None + """ + References to ResourcePolicy in compute to populate resourcePolicies. + """ + resourcePoliciesSelector: Optional[ResourcePoliciesSelector] = None + """ + Selector for a list of ResourcePolicy in compute to populate resourcePolicies. + """ + source: Optional[str] = None + """ + The name (not self_link) + of the disk (such as those managed by google_compute_disk) to attach. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImage: Optional[str] = None + """ + The image from which to + initialize this disk. This can be one of: the image's self_link, + projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption + key of the source image. Required if the source image is protected by a + customer-supplied encryption key. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + sourceSnapshot: Optional[str] = None + """ + The source snapshot to create this disk. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption + key of the source snapshot. Structure + documented below. + """ + type: Optional[str] = None + """ + The type of GCE disk, can be either "SCRATCH" or + "PERSISTENT". + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + """ + The IP address that will be 1:1 mapped to the instance's + network ip. If not given, one will be generated. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The IP CIDR range represented by this alias IP range. This IP CIDR range + must belong to the specified subnetwork and cannot contain IP addresses reserved by + system or used by other network interfaces. At the time of writing only a + netmask (e.g. /24) may be supplied, with a CIDR format resulting in an API + error. + """ + subnetworkRangeName: Optional[str] = None + """ + The subnetwork secondary range name specifying + the secondary range from which to allocate the IP CIDR range for this alias IP + range. If left unspecified, the primary range of the subnetwork will be used. + """ + + +class Ipv6AccessConfigItem(BaseModel): + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet.g. via tunnel or because it is running on another cloud instance + on that network). This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6Address: Optional[str] = None + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Use network attribute for Legacy or Auto subnetted networks and + subnetwork for custom subnetted networks. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + the name of the subnetwork to attach this interface + to. The subnetwork must exist in the same region this instance will be + created in. Either network or subnetwork must be provided. + """ + subnetworkProject: Optional[str] = None + """ + The ID of the project in which the subnetwork belongs. + If it is not provided, the provider project is used. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + The egress bandwidth tier to enable. Possible values: TIER_1, DEFAULT + """ + + +class SpecificReservation(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class ReservationAffinity(BaseModel): + specificReservation: Optional[SpecificReservation] = None + """ + Specifies the label selector for the reservation to use.. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class LocalSsdRecoveryTimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class MaxRunDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + operator: Optional[str] = None + """ + The operator. Can be IN for node-affinities + or NOT_IN for anti-affinities. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class OnInstanceStopAction(BaseModel): + discardLocalSsd: Optional[bool] = None + """ + Whether to discard local SSDs attached to the VM while terminating using max_run_duration. Only supports true at this point. + """ + + +class Scheduling(BaseModel): + automaticRestart: Optional[bool] = None + """ + Specifies whether the instance should be + automatically restarted if it is terminated by Compute Engine (not + terminated by a user). This defaults to true. + """ + availabilityDomain: Optional[float] = None + """ + Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + """ + instanceTerminationAction: Optional[str] = None + """ + Describe the type of termination action for SPOT VM. Can be STOP or DELETE. Read more on here + """ + localSsdRecoveryTimeout: Optional[List[LocalSsdRecoveryTimeoutItem]] = None + """ + io/docs/providers/google/guides/provider_versions.html) Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. Structure is documented below. + """ + maxRunDuration: Optional[MaxRunDuration] = None + """ + The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in instance_termination_action. Structure is documented below. + """ + minNodeCpus: Optional[float] = None + nodeAffinities: Optional[List[NodeAffinity]] = None + """ + Specifies node affinities or anti-affinities + to determine which sole-tenant nodes your instances and managed instance + groups will use as host systems. Read more on sole-tenant node creation + here. + Structure documented below. + """ + onHostMaintenance: Optional[str] = None + """ + Defines the maintenance behavior for this + instance. + """ + onInstanceStopAction: Optional[OnInstanceStopAction] = None + """ + Specifies the action to be performed when the instance is terminated using max_run_duration and STOP instance_termination_action. Only support true discard_local_ssd at this point. Structure is documented below. + """ + preemptible: Optional[bool] = None + """ + Allows instance to be preempted. This defaults to + false. Read more on this + here. + """ + provisioningModel: Optional[str] = None + """ + Describe the type of preemptible VM. This field accepts the value STANDARD or SPOT. If the value is STANDARD, there will be no discount. If this is set to SPOT, + preemptible should be true and automatic_restart should be + false. For more info about + SPOT, read here + """ + terminationTime: Optional[str] = None + """ + Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + """ + + +class EmailRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EmailSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceAccount(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. If not given, the + default Google Compute Engine service account is used. + """ + emailRef: Optional[EmailRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate email. + """ + emailSelector: Optional[EmailSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate email. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + - Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. + """ + enableSecureBoot: Optional[bool] = None + """ + - Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. + """ + enableVtpm: Optional[bool] = None + """ + - Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItem]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItem]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class DiskItemModel(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + autoDelete: Optional[bool] = None + """ + Whether or not the disk should be auto-deleted. + This defaults to true. + """ + boot: Optional[bool] = None + """ + Indicates that this is a boot disk. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the + /dev/ tree of a Linux operating system running within the instance. If not + specified, the server chooses a default device name to apply to this disk. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts or decrypts a disk using a customer-supplied encryption key. + """ + diskName: Optional[str] = None + """ + Name of the disk. When not provided, this defaults + to the name of the instance. + """ + diskSizeGb: Optional[float] = None + """ + The size of the image in gigabytes. If not + specified, it will inherit the size of its base image. For SCRATCH disks, + the size must be exactly 375GB. + """ + diskType: Optional[str] = None + """ + The GCE disk type. Such as "pd-ssd", "local-ssd", + "pd-balanced" or "pd-standard", "hyperdisk-balanced", "hyperdisk-throughput" or "hyperdisk-extreme". + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + interface: Optional[str] = None + """ + Specifies the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + and the request will fail if you attempt to attach a persistent disk in any other format + than SCSI. Local SSDs can use either NVME or SCSI. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of ket/value label pairs to assign to disk created from + this template + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If you are attaching or creating a boot disk, this must + read-write mode. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This + sets the number of I/O operations per second that the disk can handle. + Values must be between 10,000 and 120,000. For more details, see the + Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to this disk. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + """ + source: Optional[str] = None + """ + The name (not self_link) + of the disk (such as those managed by google_compute_disk) to attach. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImage: Optional[str] = None + """ + The image from which to + initialize this disk. This can be one of: the image's self_link, + projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + The customer-supplied encryption + key of the source image. Required if the source image is protected by a + customer-supplied encryption key. + """ + sourceSnapshot: Optional[str] = None + """ + The source snapshot to create this disk. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption + key of the source snapshot. Structure + documented below. + """ + type: Optional[str] = None + """ + The type of GCE disk, can be either "SCRATCH" or + "PERSISTENT". + """ + + +class AccessConfigItemModel(BaseModel): + natIp: Optional[str] = None + """ + The IP address that will be 1:1 mapped to the instance's + network ip. If not given, one will be generated. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The name of the instance template. + """ + + +class Ipv6AccessConfigItemModel(BaseModel): + externalIpv6: Optional[str] = None + externalIpv6PrefixLength: Optional[str] = None + name: Optional[str] = None + """ + The name of the instance template. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The name of the instance template. + """ + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItemModel]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet.g. via tunnel or because it is running on another cloud instance + on that network). This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItemModel]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6AccessType: Optional[str] = None + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + The name of the instance template. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Use network attribute for Legacy or Auto subnetted networks and + subnetwork for custom subnetted networks. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + the name of the subnetwork to attach this interface + to. The subnetwork must exist in the same region this instance will be + created in. Either network or subnetwork must be provided. + """ + subnetworkProject: Optional[str] = None + """ + The ID of the project in which the subnetwork belongs. + If it is not provided, the provider project is used. + """ + + +class ServiceAccountModel(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. If not given, the + default Google Compute Engine service account is used. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + """ + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItemModel]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + effectiveLabels: Optional[Dict[str, str]] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/instanceTemplates/{{name}} + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataFingerprint: Optional[str] = None + """ + The unique fingerprint of the metadata. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + numericId: Optional[str] = None + """ + numeric identifier of the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + selfLinkUnique: Optional[str] = None + """ + A special URI of the created resource that uniquely identifies this instance template with the following format: projects/{{project}}/global/instanceTemplates/{{name}}?uniqueId={{uniqueId}} + Referencing an instance template via this attribute prevents Time of Check to Time of Use attacks when the instance template resides in a shared/untrusted environment. + """ + serviceAccount: Optional[ServiceAccountModel] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + tagsFingerprint: Optional[str] = None + """ + The unique fingerprint of the tags. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['InstanceTemplate']] = 'InstanceTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceTemplateSpec defines the desired state of InstanceTemplate + """ + status: Optional[Status] = None + """ + InstanceTemplateStatus defines the observed state of InstanceTemplate. + """ + + +class InstanceTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceTemplate] + """ + List of instancetemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/interconnectattachment/__init__.py b/schemas/python/models/io/upbound/gcp/compute/interconnectattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/interconnectattachment/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/interconnectattachment/v1beta1.py new file mode 100644 index 000000000..d3993968c --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/interconnectattachment/v1beta1.py @@ -0,0 +1,740 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_interconnectattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class IpsecInternalAddressesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpsecInternalAddressesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + adminEnabled: Optional[bool] = None + """ + Whether the VLAN attachment is enabled or disabled. When using + PARTNER type this will Pre-Activate the interconnect attachment + """ + bandwidth: Optional[str] = None + """ + Provisioned bandwidth capacity for the interconnect attachment. + For attachments of type DEDICATED, the user can set the bandwidth. + For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. + Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, + Defaults to BPS_10G + Possible values are: BPS_50M, BPS_100M, BPS_200M, BPS_300M, BPS_400M, BPS_500M, BPS_1G, BPS_2G, BPS_5G, BPS_10G, BPS_20G, BPS_50G, BPS_100G. + """ + candidateSubnets: Optional[List[str]] = None + """ + Up to 16 candidate prefixes that can be used to restrict the allocation + of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + All prefixes must be within link-local address space (169.254.0.0/16) + and must be /29 or shorter (/28, /27, etc). Google will attempt to select + an unused /29 from the supplied candidate prefix(es). The request will + fail if all possible /29s are in use on Google's edge. If not supplied, + Google will randomly select an unused /29 from all of link-local space. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeAvailabilityDomain: Optional[str] = None + """ + Desired availability domain for the attachment. Only available for type + PARTNER, at creation time. For improved reliability, customers should + configure a pair of attachments with one per availability domain. The + selected availability domain will be provided to the Partner via the + pairing key so that the provisioned circuit will lie in the specified + domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + """ + encryption: Optional[str] = None + """ + Indicates the user-supplied encryption option of this interconnect + attachment. Can only be specified at attachment creation for PARTNER or + DEDICATED attachments. + """ + interconnect: Optional[str] = None + """ + URL of the underlying Interconnect object that this attachment's + traffic will traverse through. Required if type is DEDICATED, must not + be set if type is PARTNER. + """ + ipsecInternalAddresses: Optional[List[str]] = None + """ + URL of addresses that have been reserved for the interconnect attachment, + Used only for interconnect attachment that has the encryption option as + IPSEC. + The addresses must be RFC 1918 IP address ranges. When creating HA VPN + gateway over the interconnect attachment, if the attachment is configured + to use an RFC 1918 IP address, then the VPN gateway's IP address will be + allocated from the IP address range specified here. + For example, if the HA VPN gateway's interface 0 is paired to this + interconnect attachment, then an RFC 1918 IP address for the VPN gateway + interface 0 will be allocated from the IP address specified for this + interconnect attachment. + If this field is not specified for interconnect attachment that has + encryption option as IPSEC, later on when creating HA VPN gateway on this + interconnect attachment, the HA VPN gateway's IP address will be + allocated from regional external IP address pool. + """ + ipsecInternalAddressesRefs: Optional[List[IpsecInternalAddressesRef]] = None + """ + References to Address in compute to populate ipsecInternalAddresses. + """ + ipsecInternalAddressesSelector: Optional[IpsecInternalAddressesSelector] = None + """ + Selector for a list of Address in compute to populate ipsecInternalAddresses. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels + method. Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + mtu: Optional[str] = None + """ + Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. + Valid values are 1440, 1460, 1500, and 8896. If not specified, the value will default to 1440. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the regional interconnect attachment resides. + """ + router: Optional[str] = None + """ + URL of the cloud router to be used for dynamic routing. This router must be in + the same region as this InterconnectAttachment. The InterconnectAttachment will + automatically connect the Interconnect to the network & region within which the + Cloud Router is configured. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + stackType: Optional[str] = None + """ + The stack type for this interconnect attachment to identify whether the IPv6 + feature is enabled or not. If not specified, IPV4_ONLY will be used. + This field can be both set at interconnect attachments creation and update + interconnect attachment operations. + Possible values are: IPV4_IPV6, IPV4_ONLY. + """ + subnetLength: Optional[float] = None + """ + Length of the IPv4 subnet mask. Allowed values: 29 (default), 30. The default value is 29, + except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a + constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure + remote location fall into this category. In these cases, the default value is 30, and + requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it + gives Google Cloud Support more debugging visibility. + """ + type: Optional[str] = None + """ + The type of InterconnectAttachment you wish to create. Defaults to + DEDICATED. + Possible values are: DEDICATED, PARTNER, PARTNER_PROVIDER. + """ + vlanTag8021Q: Optional[float] = None + """ + The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When + using PARTNER type this will be managed upstream. + """ + + +class InitProvider(BaseModel): + adminEnabled: Optional[bool] = None + """ + Whether the VLAN attachment is enabled or disabled. When using + PARTNER type this will Pre-Activate the interconnect attachment + """ + bandwidth: Optional[str] = None + """ + Provisioned bandwidth capacity for the interconnect attachment. + For attachments of type DEDICATED, the user can set the bandwidth. + For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. + Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, + Defaults to BPS_10G + Possible values are: BPS_50M, BPS_100M, BPS_200M, BPS_300M, BPS_400M, BPS_500M, BPS_1G, BPS_2G, BPS_5G, BPS_10G, BPS_20G, BPS_50G, BPS_100G. + """ + candidateSubnets: Optional[List[str]] = None + """ + Up to 16 candidate prefixes that can be used to restrict the allocation + of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + All prefixes must be within link-local address space (169.254.0.0/16) + and must be /29 or shorter (/28, /27, etc). Google will attempt to select + an unused /29 from the supplied candidate prefix(es). The request will + fail if all possible /29s are in use on Google's edge. If not supplied, + Google will randomly select an unused /29 from all of link-local space. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeAvailabilityDomain: Optional[str] = None + """ + Desired availability domain for the attachment. Only available for type + PARTNER, at creation time. For improved reliability, customers should + configure a pair of attachments with one per availability domain. The + selected availability domain will be provided to the Partner via the + pairing key so that the provisioned circuit will lie in the specified + domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + """ + encryption: Optional[str] = None + """ + Indicates the user-supplied encryption option of this interconnect + attachment. Can only be specified at attachment creation for PARTNER or + DEDICATED attachments. + """ + interconnect: Optional[str] = None + """ + URL of the underlying Interconnect object that this attachment's + traffic will traverse through. Required if type is DEDICATED, must not + be set if type is PARTNER. + """ + ipsecInternalAddresses: Optional[List[str]] = None + """ + URL of addresses that have been reserved for the interconnect attachment, + Used only for interconnect attachment that has the encryption option as + IPSEC. + The addresses must be RFC 1918 IP address ranges. When creating HA VPN + gateway over the interconnect attachment, if the attachment is configured + to use an RFC 1918 IP address, then the VPN gateway's IP address will be + allocated from the IP address range specified here. + For example, if the HA VPN gateway's interface 0 is paired to this + interconnect attachment, then an RFC 1918 IP address for the VPN gateway + interface 0 will be allocated from the IP address specified for this + interconnect attachment. + If this field is not specified for interconnect attachment that has + encryption option as IPSEC, later on when creating HA VPN gateway on this + interconnect attachment, the HA VPN gateway's IP address will be + allocated from regional external IP address pool. + """ + ipsecInternalAddressesRefs: Optional[List[IpsecInternalAddressesRef]] = None + """ + References to Address in compute to populate ipsecInternalAddresses. + """ + ipsecInternalAddressesSelector: Optional[IpsecInternalAddressesSelector] = None + """ + Selector for a list of Address in compute to populate ipsecInternalAddresses. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels + method. Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + mtu: Optional[str] = None + """ + Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. + Valid values are 1440, 1460, 1500, and 8896. If not specified, the value will default to 1440. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + router: Optional[str] = None + """ + URL of the cloud router to be used for dynamic routing. This router must be in + the same region as this InterconnectAttachment. The InterconnectAttachment will + automatically connect the Interconnect to the network & region within which the + Cloud Router is configured. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + stackType: Optional[str] = None + """ + The stack type for this interconnect attachment to identify whether the IPv6 + feature is enabled or not. If not specified, IPV4_ONLY will be used. + This field can be both set at interconnect attachments creation and update + interconnect attachment operations. + Possible values are: IPV4_IPV6, IPV4_ONLY. + """ + subnetLength: Optional[float] = None + """ + Length of the IPv4 subnet mask. Allowed values: 29 (default), 30. The default value is 29, + except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a + constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure + remote location fall into this category. In these cases, the default value is 30, and + requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it + gives Google Cloud Support more debugging visibility. + """ + type: Optional[str] = None + """ + The type of InterconnectAttachment you wish to create. Defaults to + DEDICATED. + Possible values are: DEDICATED, PARTNER, PARTNER_PROVIDER. + """ + vlanTag8021Q: Optional[float] = None + """ + The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When + using PARTNER type this will be managed upstream. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class PrivateInterconnectInfoItem(BaseModel): + tag8021q: Optional[float] = None + """ + (Output) + 802.1q encapsulation tag to be used for traffic between + Google and the customer, going to and from this network and region. + """ + + +class AtProvider(BaseModel): + adminEnabled: Optional[bool] = None + """ + Whether the VLAN attachment is enabled or disabled. When using + PARTNER type this will Pre-Activate the interconnect attachment + """ + attachmentGroup: Optional[str] = None + """ + URL of the AttachmentGroup that includes this Attachment. + """ + bandwidth: Optional[str] = None + """ + Provisioned bandwidth capacity for the interconnect attachment. + For attachments of type DEDICATED, the user can set the bandwidth. + For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. + Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, + Defaults to BPS_10G + Possible values are: BPS_50M, BPS_100M, BPS_200M, BPS_300M, BPS_400M, BPS_500M, BPS_1G, BPS_2G, BPS_5G, BPS_10G, BPS_20G, BPS_50G, BPS_100G. + """ + candidateSubnets: Optional[List[str]] = None + """ + Up to 16 candidate prefixes that can be used to restrict the allocation + of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + All prefixes must be within link-local address space (169.254.0.0/16) + and must be /29 or shorter (/28, /27, etc). Google will attempt to select + an unused /29 from the supplied candidate prefix(es). The request will + fail if all possible /29s are in use on Google's edge. If not supplied, + Google will randomly select an unused /29 from all of link-local space. + """ + cloudRouterIpAddress: Optional[str] = None + """ + IPv4 address + prefix length to be configured on Cloud Router + Interface for this interconnect attachment. + """ + cloudRouterIpv6Address: Optional[str] = None + """ + IPv6 address + prefix length to be configured on Cloud Router + Interface for this interconnect attachment. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customerRouterIpAddress: Optional[str] = None + """ + IPv4 address + prefix length to be configured on the customer + router subinterface for this interconnect attachment. + """ + customerRouterIpv6Address: Optional[str] = None + """ + IPv6 address + prefix length to be configured on the customer + router subinterface for this interconnect attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeAvailabilityDomain: Optional[str] = None + """ + Desired availability domain for the attachment. Only available for type + PARTNER, at creation time. For improved reliability, customers should + configure a pair of attachments with one per availability domain. The + selected availability domain will be provided to the Partner via the + pairing key so that the provisioned circuit will lie in the specified + domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + encryption: Optional[str] = None + """ + Indicates the user-supplied encryption option of this interconnect + attachment. Can only be specified at attachment creation for PARTNER or + DEDICATED attachments. + """ + googleReferenceId: Optional[str] = None + """ + Google reference ID, to be used when raising support tickets with + Google or otherwise to debug backend connectivity issues. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}} + """ + interconnect: Optional[str] = None + """ + URL of the underlying Interconnect object that this attachment's + traffic will traverse through. Required if type is DEDICATED, must not + be set if type is PARTNER. + """ + ipsecInternalAddresses: Optional[List[str]] = None + """ + URL of addresses that have been reserved for the interconnect attachment, + Used only for interconnect attachment that has the encryption option as + IPSEC. + The addresses must be RFC 1918 IP address ranges. When creating HA VPN + gateway over the interconnect attachment, if the attachment is configured + to use an RFC 1918 IP address, then the VPN gateway's IP address will be + allocated from the IP address range specified here. + For example, if the HA VPN gateway's interface 0 is paired to this + interconnect attachment, then an RFC 1918 IP address for the VPN gateway + interface 0 will be allocated from the IP address specified for this + interconnect attachment. + If this field is not specified for interconnect attachment that has + encryption option as IPSEC, later on when creating HA VPN gateway on this + interconnect attachment, the HA VPN gateway's IP address will be + allocated from regional external IP address pool. + """ + labelFingerprint: Optional[str] = None + """ + A fingerprint for the labels being applied to this Interconnect, which is essentially a hash + of the labels set used for optimistic locking. The fingerprint is initially generated by + Compute Engine and changes after every request to modify or update labels. + You must always provide an up-to-date fingerprint hash in order to update or change labels, + otherwise the request will fail with error 412 conditionNotMet. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels + method. Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + mtu: Optional[str] = None + """ + Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. + Valid values are 1440, 1460, 1500, and 8896. If not specified, the value will default to 1440. + """ + pairingKey: Optional[str] = None + """ + [Output only for type PARTNER. Not present for DEDICATED]. The opaque + identifier of an PARTNER attachment used to initiate provisioning with + a selected partner. Of the form "XXXXX/region/domain" + """ + partnerAsn: Optional[str] = None + """ + [Output only for type PARTNER. Not present for DEDICATED]. Optional + BGP ASN for the router that should be supplied by a layer 3 Partner if + they configured BGP on behalf of the customer. + """ + privateInterconnectInfo: Optional[List[PrivateInterconnectInfoItem]] = None + """ + Information specific to an InterconnectAttachment. This property + is populated if the interconnect that this is attached to is of type DEDICATED. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the regional interconnect attachment resides. + """ + router: Optional[str] = None + """ + URL of the cloud router to be used for dynamic routing. This router must be in + the same region as this InterconnectAttachment. The InterconnectAttachment will + automatically connect the Interconnect to the network & region within which the + Cloud Router is configured. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + stackType: Optional[str] = None + """ + The stack type for this interconnect attachment to identify whether the IPv6 + feature is enabled or not. If not specified, IPV4_ONLY will be used. + This field can be both set at interconnect attachments creation and update + interconnect attachment operations. + Possible values are: IPV4_IPV6, IPV4_ONLY. + """ + state: Optional[str] = None + """ + [Output Only] The current state of this attachment's functionality. + """ + subnetLength: Optional[float] = None + """ + Length of the IPv4 subnet mask. Allowed values: 29 (default), 30. The default value is 29, + except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a + constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure + remote location fall into this category. In these cases, the default value is 30, and + requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it + gives Google Cloud Support more debugging visibility. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + The type of InterconnectAttachment you wish to create. Defaults to + DEDICATED. + Possible values are: DEDICATED, PARTNER, PARTNER_PROVIDER. + """ + vlanTag8021Q: Optional[float] = None + """ + The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When + using PARTNER type this will be managed upstream. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InterconnectAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['InterconnectAttachment']] = 'InterconnectAttachment' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InterconnectAttachmentSpec defines the desired state of InterconnectAttachment + """ + status: Optional[Status] = None + """ + InterconnectAttachmentStatus defines the observed state of InterconnectAttachment. + """ + + +class InterconnectAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InterconnectAttachment] + """ + List of interconnectattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/__init__.py b/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta1.py new file mode 100644 index 000000000..f94110ac3 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta1.py @@ -0,0 +1,304 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_managedsslcertificate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ManagedItem(BaseModel): + domains: Optional[List[str]] = None + """ + Domains for which a managed SSL certificate will be valid. Currently, + there can be up to 100 domains in this list. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + managed: Optional[List[ManagedItem]] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + managed: Optional[List[ManagedItem]] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateId: Optional[float] = None + """ + The unique identifier for the resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + expireTime: Optional[str] = None + """ + Expire time of the certificate in RFC3339 text format. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/sslCertificates/{{name}} + """ + managed: Optional[List[ManagedItem]] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subjectAlternativeNames: Optional[List[str]] = None + """ + Domains associated with the certificate via Subject Alternative Name. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ManagedSSLCertificate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ManagedSSLCertificate']] = 'ManagedSSLCertificate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ManagedSSLCertificateSpec defines the desired state of ManagedSSLCertificate + """ + status: Optional[Status] = None + """ + ManagedSSLCertificateStatus defines the observed state of ManagedSSLCertificate. + """ + + +class ManagedSSLCertificateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ManagedSSLCertificate] + """ + List of managedsslcertificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta2.py new file mode 100644 index 000000000..ea2752ae8 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/managedsslcertificate/v1beta2.py @@ -0,0 +1,304 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_managedsslcertificate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Managed(BaseModel): + domains: Optional[List[str]] = None + """ + Domains for which a managed SSL certificate will be valid. Currently, + there can be up to 100 domains in this list. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + managed: Optional[Managed] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + managed: Optional[Managed] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateId: Optional[float] = None + """ + The unique identifier for the resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + expireTime: Optional[str] = None + """ + Expire time of the certificate in RFC3339 text format. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/sslCertificates/{{name}} + """ + managed: Optional[Managed] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subjectAlternativeNames: Optional[List[str]] = None + """ + Domains associated with the certificate via Subject Alternative Name. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ManagedSSLCertificate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['ManagedSSLCertificate']] = 'ManagedSSLCertificate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ManagedSSLCertificateSpec defines the desired state of ManagedSSLCertificate + """ + status: Optional[Status] = None + """ + ManagedSSLCertificateStatus defines the observed state of ManagedSSLCertificate. + """ + + +class ManagedSSLCertificateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ManagedSSLCertificate] + """ + List of managedsslcertificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/network/__init__.py b/schemas/python/models/io/upbound/gcp/compute/network/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/network/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/network/v1beta1.py new file mode 100644 index 000000000..5a11e7158 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/network/v1beta1.py @@ -0,0 +1,492 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_network.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the network. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. + """ + + +class ForProvider(BaseModel): + autoCreateSubnetworks: Optional[bool] = None + """ + When set to true, the network is created in "auto subnet mode" and + it will create a subnet for each region automatically across the + 10.128.0.0/9 address range. + When set to false, the network is created in "custom subnet mode" so + the user can explicitly connect subnetwork resources. + """ + bgpAlwaysCompareMed: Optional[bool] = None + """ + Enables/disables the comparison of MED across routes with different Neighbor ASNs. + This value can only be set if the --bgp-best-path-selection-mode is STANDARD + """ + bgpBestPathSelectionMode: Optional[str] = None + """ + The BGP best selection algorithm to be employed. MODE can be LEGACY or STANDARD. + Possible values are: LEGACY, STANDARD. + """ + bgpInterRegionCost: Optional[str] = None + """ + Choice of the behavior of inter-regional cost and MED in the BPS algorithm. + Possible values are: DEFAULT, ADD_COST_TO_MED. + """ + deleteDefaultRoutesOnCreate: Optional[bool] = None + """ + If set to true, default routes (0.0.0.0/0) will be deleted + immediately after network creation. Defaults to false. + """ + description: Optional[str] = None + """ + An optional description of this resource. The resource must be + recreated to modify this field. + """ + enableUlaInternalIpv6: Optional[bool] = None + """ + Enable ULA internal ipv6 on this network. Enabling this feature will assign + a /48 from google defined ULA prefix fd20::/20. + """ + internalIpv6Range: Optional[str] = None + """ + When enabling ula internal ipv6, caller optionally can specify the /48 range + they want from the google defined ULA prefix fd20::/20. The input must be a + valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will + fail if the speficied /48 is already in used by another resource. + If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. + """ + mtu: Optional[float] = None + """ + Maximum Transmission Unit in bytes. The default value is 1460 bytes. + The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). + Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped + with an ICMP Fragmentation-Needed message if the packets are routed to the Internet or other VPCs + with varying MTUs. + """ + networkFirewallPolicyEnforcementOrder: Optional[str] = None + """ + Set the order that Firewall Rules and Firewall Policies are evaluated. + Default value is AFTER_CLASSIC_FIREWALL. + Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL. + """ + networkProfile: Optional[str] = None + """ + A full or partial URL of the network profile to apply to this network. + This field can be set only at resource creation time. For example, the + following are valid URLs: + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routingMode: Optional[str] = None + """ + The network-wide routing mode to use. If set to REGIONAL, this + network's cloud routers will only advertise routes with subnetworks + of this network in the same region as the router. If set to GLOBAL, + this network's cloud routers will advertise routes with all + subnetworks of this network, across regions. + Possible values are: REGIONAL, GLOBAL. + """ + + +class InitProvider(BaseModel): + autoCreateSubnetworks: Optional[bool] = None + """ + When set to true, the network is created in "auto subnet mode" and + it will create a subnet for each region automatically across the + 10.128.0.0/9 address range. + When set to false, the network is created in "custom subnet mode" so + the user can explicitly connect subnetwork resources. + """ + bgpAlwaysCompareMed: Optional[bool] = None + """ + Enables/disables the comparison of MED across routes with different Neighbor ASNs. + This value can only be set if the --bgp-best-path-selection-mode is STANDARD + """ + bgpBestPathSelectionMode: Optional[str] = None + """ + The BGP best selection algorithm to be employed. MODE can be LEGACY or STANDARD. + Possible values are: LEGACY, STANDARD. + """ + bgpInterRegionCost: Optional[str] = None + """ + Choice of the behavior of inter-regional cost and MED in the BPS algorithm. + Possible values are: DEFAULT, ADD_COST_TO_MED. + """ + deleteDefaultRoutesOnCreate: Optional[bool] = None + """ + If set to true, default routes (0.0.0.0/0) will be deleted + immediately after network creation. Defaults to false. + """ + description: Optional[str] = None + """ + An optional description of this resource. The resource must be + recreated to modify this field. + """ + enableUlaInternalIpv6: Optional[bool] = None + """ + Enable ULA internal ipv6 on this network. Enabling this feature will assign + a /48 from google defined ULA prefix fd20::/20. + """ + internalIpv6Range: Optional[str] = None + """ + When enabling ula internal ipv6, caller optionally can specify the /48 range + they want from the google defined ULA prefix fd20::/20. The input must be a + valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will + fail if the speficied /48 is already in used by another resource. + If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. + """ + mtu: Optional[float] = None + """ + Maximum Transmission Unit in bytes. The default value is 1460 bytes. + The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). + Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped + with an ICMP Fragmentation-Needed message if the packets are routed to the Internet or other VPCs + with varying MTUs. + """ + networkFirewallPolicyEnforcementOrder: Optional[str] = None + """ + Set the order that Firewall Rules and Firewall Policies are evaluated. + Default value is AFTER_CLASSIC_FIREWALL. + Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL. + """ + networkProfile: Optional[str] = None + """ + A full or partial URL of the network profile to apply to this network. + This field can be set only at resource creation time. For example, the + following are valid URLs: + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routingMode: Optional[str] = None + """ + The network-wide routing mode to use. If set to REGIONAL, this + network's cloud routers will only advertise routes with subnetworks + of this network in the same region as the router. If set to GLOBAL, + this network's cloud routers will advertise routes with all + subnetworks of this network, across regions. + Possible values are: REGIONAL, GLOBAL. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoCreateSubnetworks: Optional[bool] = None + """ + When set to true, the network is created in "auto subnet mode" and + it will create a subnet for each region automatically across the + 10.128.0.0/9 address range. + When set to false, the network is created in "custom subnet mode" so + the user can explicitly connect subnetwork resources. + """ + bgpAlwaysCompareMed: Optional[bool] = None + """ + Enables/disables the comparison of MED across routes with different Neighbor ASNs. + This value can only be set if the --bgp-best-path-selection-mode is STANDARD + """ + bgpBestPathSelectionMode: Optional[str] = None + """ + The BGP best selection algorithm to be employed. MODE can be LEGACY or STANDARD. + Possible values are: LEGACY, STANDARD. + """ + bgpInterRegionCost: Optional[str] = None + """ + Choice of the behavior of inter-regional cost and MED in the BPS algorithm. + Possible values are: DEFAULT, ADD_COST_TO_MED. + """ + deleteDefaultRoutesOnCreate: Optional[bool] = None + """ + If set to true, default routes (0.0.0.0/0) will be deleted + immediately after network creation. Defaults to false. + """ + description: Optional[str] = None + """ + An optional description of this resource. The resource must be + recreated to modify this field. + """ + enableUlaInternalIpv6: Optional[bool] = None + """ + Enable ULA internal ipv6 on this network. Enabling this feature will assign + a /48 from google defined ULA prefix fd20::/20. + """ + gatewayIpv4: Optional[str] = None + """ + The gateway address for default routing out of the network. This value + is selected by GCP. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/networks/{{name}} + """ + internalIpv6Range: Optional[str] = None + """ + When enabling ula internal ipv6, caller optionally can specify the /48 range + they want from the google defined ULA prefix fd20::/20. The input must be a + valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will + fail if the speficied /48 is already in used by another resource. + If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. + """ + mtu: Optional[float] = None + """ + Maximum Transmission Unit in bytes. The default value is 1460 bytes. + The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). + Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped + with an ICMP Fragmentation-Needed message if the packets are routed to the Internet or other VPCs + with varying MTUs. + """ + networkFirewallPolicyEnforcementOrder: Optional[str] = None + """ + Set the order that Firewall Rules and Firewall Policies are evaluated. + Default value is AFTER_CLASSIC_FIREWALL. + Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL. + """ + networkId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + networkProfile: Optional[str] = None + """ + A full or partial URL of the network profile to apply to this network. + This field can be set only at resource creation time. For example, the + following are valid URLs: + """ + numericId: Optional[str] = None + """ + (Deprecated) + The unique identifier for the resource. This identifier is defined by the server. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routingMode: Optional[str] = None + """ + The network-wide routing mode to use. If set to REGIONAL, this + network's cloud routers will only advertise routes with subnetworks + of this network in the same region as the router. If set to GLOBAL, + this network's cloud routers will advertise routes with all + subnetworks of this network, across regions. + Possible values are: REGIONAL, GLOBAL. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Network(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Network']] = 'Network' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkSpec defines the desired state of Network + """ + status: Optional[Status] = None + """ + NetworkStatus defines the observed state of Network. + """ + + +class NetworkList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Network] + """ + List of networks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/networkendpoint/__init__.py b/schemas/python/models/io/upbound/gcp/compute/networkendpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/networkendpoint/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/networkendpoint/v1beta1.py new file mode 100644 index 000000000..1a7b96b6e --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/networkendpoint/v1beta1.py @@ -0,0 +1,389 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_networkendpoint.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkEndpointGroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkEndpointGroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + instance: Optional[str] = None + """ + The name for a specific VM instance that the IP address belongs to. + This is required for network endpoints of type GCE_VM_IP_PORT. + The instance must be in the same zone of network endpoint group. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + ipAddress: Optional[str] = None + """ + IPv4 address of network endpoint. The IP address must belong + to a VM in GCE (either the primary IP or as part of an aliased IP + range). + """ + networkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + networkEndpointGroupRef: Optional[NetworkEndpointGroupRef] = None + """ + Reference to a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + networkEndpointGroupSelector: Optional[NetworkEndpointGroupSelector] = None + """ + Selector for a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + Note port is required unless the Network Endpoint Group is created + with the type of GCE_VM_IP + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + Zone where the containing network endpoint group is located. + """ + + +class InitProvider(BaseModel): + instance: Optional[str] = None + """ + The name for a specific VM instance that the IP address belongs to. + This is required for network endpoints of type GCE_VM_IP_PORT. + The instance must be in the same zone of network endpoint group. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + ipAddress: Optional[str] = None + """ + IPv4 address of network endpoint. The IP address must belong + to a VM in GCE (either the primary IP or as part of an aliased IP + range). + """ + networkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + networkEndpointGroupRef: Optional[NetworkEndpointGroupRef] = None + """ + Reference to a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + networkEndpointGroupSelector: Optional[NetworkEndpointGroupSelector] = None + """ + Selector for a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + Note port is required unless the Network Endpoint Group is created + with the type of GCE_VM_IP + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + Zone where the containing network endpoint group is located. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}} + """ + instance: Optional[str] = None + """ + The name for a specific VM instance that the IP address belongs to. + This is required for network endpoints of type GCE_VM_IP_PORT. + The instance must be in the same zone of network endpoint group. + """ + ipAddress: Optional[str] = None + """ + IPv4 address of network endpoint. The IP address must belong + to a VM in GCE (either the primary IP or as part of an aliased IP + range). + """ + networkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + Note port is required unless the Network Endpoint Group is created + with the type of GCE_VM_IP + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + Zone where the containing network endpoint group is located. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkEndpoint(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkEndpoint']] = 'NetworkEndpoint' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkEndpointSpec defines the desired state of NetworkEndpoint + """ + status: Optional[Status] = None + """ + NetworkEndpointStatus defines the observed state of NetworkEndpoint. + """ + + +class NetworkEndpointList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkEndpoint] + """ + List of networkendpoints. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/networkendpointgroup/__init__.py b/schemas/python/models/io/upbound/gcp/compute/networkendpointgroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/networkendpointgroup/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/networkendpointgroup/v1beta1.py new file mode 100644 index 000000000..a3c3ff492 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/networkendpointgroup/v1beta1.py @@ -0,0 +1,427 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_networkendpointgroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + The network to which all network endpoints in the NEG belong. + Uses "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + NON_GCP_PRIVATE_IP_PORT is used for hybrid connectivity network + endpoint groups (see https://cloud.google.com/load-balancing/docs/hybrid). + Note that NON_GCP_PRIVATE_IP_PORT can only be used with Backend Services + that 1) have the following load balancing schemes: EXTERNAL, EXTERNAL_MANAGED, + INTERNAL_MANAGED, and INTERNAL_SELF_MANAGED and 2) support the RATE or + CONNECTION balancing modes. + Possible values include: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, and PRIVATE_SERVICE_CONNECT. + Default value is GCE_VM_IP_PORT. + Possible values are: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + subnetwork: Optional[str] = None + """ + Optional subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + zone: str + """ + Zone where the network endpoint group is located. + """ + + +class InitProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + The network to which all network endpoints in the NEG belong. + Uses "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + NON_GCP_PRIVATE_IP_PORT is used for hybrid connectivity network + endpoint groups (see https://cloud.google.com/load-balancing/docs/hybrid). + Note that NON_GCP_PRIVATE_IP_PORT can only be used with Backend Services + that 1) have the following load balancing schemes: EXTERNAL, EXTERNAL_MANAGED, + INTERNAL_MANAGED, and INTERNAL_SELF_MANAGED and 2) support the RATE or + CONNECTION balancing modes. + Possible values include: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, and PRIVATE_SERVICE_CONNECT. + Default value is GCE_VM_IP_PORT. + Possible values are: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + subnetwork: Optional[str] = None + """ + Optional subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + generatedId: Optional[float] = None + """ + The uniquely generated identifier for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{name}} + """ + network: Optional[str] = None + """ + The network to which all network endpoints in the NEG belong. + Uses "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + NON_GCP_PRIVATE_IP_PORT is used for hybrid connectivity network + endpoint groups (see https://cloud.google.com/load-balancing/docs/hybrid). + Note that NON_GCP_PRIVATE_IP_PORT can only be used with Backend Services + that 1) have the following load balancing schemes: EXTERNAL, EXTERNAL_MANAGED, + INTERNAL_MANAGED, and INTERNAL_SELF_MANAGED and 2) support the RATE or + CONNECTION balancing modes. + Possible values include: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, and PRIVATE_SERVICE_CONNECT. + Default value is GCE_VM_IP_PORT. + Possible values are: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Number of network endpoints in the network endpoint group. + """ + subnetwork: Optional[str] = None + """ + Optional subnetwork to which all network endpoints in the NEG belong. + """ + zone: Optional[str] = None + """ + Zone where the network endpoint group is located. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkEndpointGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkEndpointGroup']] = 'NetworkEndpointGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkEndpointGroupSpec defines the desired state of NetworkEndpointGroup + """ + status: Optional[Status] = None + """ + NetworkEndpointGroupStatus defines the observed state of NetworkEndpointGroup. + """ + + +class NetworkEndpointGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkEndpointGroup] + """ + List of networkendpointgroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicy/v1beta1.py new file mode 100644 index 000000000..475561ea8 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicy/v1beta1.py @@ -0,0 +1,261 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_networkfirewallpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of the resource. This field is used internally during updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewallPolicies/{{name}} + """ + networkFirewallPolicyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleTupleCount: Optional[float] = None + """ + Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkFirewallPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkFirewallPolicy']] = 'NetworkFirewallPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkFirewallPolicySpec defines the desired state of NetworkFirewallPolicy + """ + status: Optional[Status] = None + """ + NetworkFirewallPolicyStatus defines the observed state of NetworkFirewallPolicy. + """ + + +class NetworkFirewallPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkFirewallPolicy] + """ + List of networkfirewallpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyassociation/__init__.py b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyassociation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyassociation/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyassociation/v1beta1.py new file mode 100644 index 000000000..f36d26540 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyassociation/v1beta1.py @@ -0,0 +1,329 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_networkfirewallpolicyassociation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class AttachmentTargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class AttachmentTargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shortName: Optional[str] = None + """ + The short name of the firewall policy of the association. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkFirewallPolicyAssociation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkFirewallPolicyAssociation']] = ( + 'NetworkFirewallPolicyAssociation' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkFirewallPolicyAssociationSpec defines the desired state of NetworkFirewallPolicyAssociation + """ + status: Optional[Status] = None + """ + NetworkFirewallPolicyAssociationStatus defines the observed state of NetworkFirewallPolicyAssociation. + """ + + +class NetworkFirewallPolicyAssociationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkFirewallPolicyAssociation] + """ + List of networkfirewallpolicyassociations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyrule/__init__.py b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyrule/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyrule/v1beta1.py new file mode 100644 index 000000000..36c7f4113 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/networkfirewallpolicyrule/v1beta1.py @@ -0,0 +1,690 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_networkfirewallpolicyrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Layer4Config(BaseModel): + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. + This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + """ + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + """ + + +class SrcAddressGroupsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SrcAddressGroupsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SrcSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class Match(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcAddressGroupsRefs: Optional[List[SrcAddressGroupsRef]] = None + """ + References to AddressGroup in networksecurity to populate srcAddressGroups. + """ + srcAddressGroupsSelector: Optional[SrcAddressGroupsSelector] = None + """ + Selector for a list of AddressGroup in networksecurity to populate srcAddressGroups. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTag]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + + +class ForProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: float + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleName: Optional[str] = None + """ + An optional name for the rule. This field is not a unique identifier and can be updated. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class InitProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleName: Optional[str] = None + """ + An optional name for the rule. This field is not a unique identifier and can be updated. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SrcSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class MatchModel(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTagModel]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class AtProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}} + """ + kind: Optional[str] = None + """ + Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + """ + match: Optional[MatchModel] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleName: Optional[str] = None + """ + An optional name for the rule. This field is not a unique identifier and can be updated. + """ + ruleTupleCount: Optional[float] = None + """ + Calculation of the complexity of a single firewall policy rule. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetSecureTags: Optional[List[TargetSecureTagModel]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkFirewallPolicyRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkFirewallPolicyRule']] = 'NetworkFirewallPolicyRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkFirewallPolicyRuleSpec defines the desired state of NetworkFirewallPolicyRule + """ + status: Optional[Status] = None + """ + NetworkFirewallPolicyRuleStatus defines the observed state of NetworkFirewallPolicyRule. + """ + + +class NetworkFirewallPolicyRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkFirewallPolicyRule] + """ + List of networkfirewallpolicyrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/networkpeering/__init__.py b/schemas/python/models/io/upbound/gcp/compute/networkpeering/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/networkpeering/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/networkpeering/v1beta1.py new file mode 100644 index 000000000..8bf3efd16 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/networkpeering/v1beta1.py @@ -0,0 +1,380 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_networkpeering.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PeerNetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeerNetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. Defaults to false. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes from the peer network. Defaults to false. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field. + """ + network: Optional[str] = None + """ + The primary network of the peering. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + peerNetwork: Optional[str] = None + """ + The peer network in the peering. The peer network + may belong to a different project. + """ + peerNetworkRef: Optional[PeerNetworkRef] = None + """ + Reference to a Network in compute to populate peerNetwork. + """ + peerNetworkSelector: Optional[PeerNetworkSelector] = None + """ + Selector for a Network in compute to populate peerNetwork. + """ + stackType: Optional[str] = None + """ + Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"]. + """ + + +class InitProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. Defaults to false. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes from the peer network. Defaults to false. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field. + """ + peerNetwork: Optional[str] = None + """ + The peer network in the peering. The peer network + may belong to a different project. + """ + peerNetworkRef: Optional[PeerNetworkRef] = None + """ + Reference to a Network in compute to populate peerNetwork. + """ + peerNetworkSelector: Optional[PeerNetworkSelector] = None + """ + Selector for a Network in compute to populate peerNetwork. + """ + stackType: Optional[str] = None + """ + Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"]. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. Defaults to false. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{network}}/{{name}} + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes from the peer network. Defaults to false. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field. + """ + network: Optional[str] = None + """ + The primary network of the peering. + """ + peerNetwork: Optional[str] = None + """ + The peer network in the peering. The peer network + may belong to a different project. + """ + stackType: Optional[str] = None + """ + Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"]. + """ + state: Optional[str] = None + """ + State for the peering, either ACTIVE or INACTIVE. The peering is + ACTIVE when there's a matching configuration in the peer network. + """ + stateDetails: Optional[str] = None + """ + Details about the current state of the peering. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkPeering(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkPeering']] = 'NetworkPeering' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkPeeringSpec defines the desired state of NetworkPeering + """ + status: Optional[Status] = None + """ + NetworkPeeringStatus defines the observed state of NetworkPeering. + """ + + +class NetworkPeeringList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkPeering] + """ + List of networkpeerings. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/networkpeeringroutesconfig/__init__.py b/schemas/python/models/io/upbound/gcp/compute/networkpeeringroutesconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/networkpeeringroutesconfig/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/networkpeeringroutesconfig/v1beta1.py new file mode 100644 index 000000000..f5460ac4c --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/networkpeeringroutesconfig/v1beta1.py @@ -0,0 +1,395 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_networkpeeringroutesconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PeeringRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeeringSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. + IPv4 special-use ranges are always exported to peers and + are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes to the peer network. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. + IPv4 special-use ranges are always imported from peers and + are not controlled by this field. + """ + network: Optional[str] = None + """ + The name of the primary network for the peering. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + peering: Optional[str] = None + """ + Name of the peering. + """ + peeringRef: Optional[PeeringRef] = None + """ + Reference to a NetworkPeering in compute to populate peering. + """ + peeringSelector: Optional[PeeringSelector] = None + """ + Selector for a NetworkPeering in compute to populate peering. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. + IPv4 special-use ranges are always exported to peers and + are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes to the peer network. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. + IPv4 special-use ranges are always imported from peers and + are not controlled by this field. + """ + network: Optional[str] = None + """ + The name of the primary network for the peering. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + peering: Optional[str] = None + """ + Name of the peering. + """ + peeringRef: Optional[PeeringRef] = None + """ + Reference to a NetworkPeering in compute to populate peering. + """ + peeringSelector: Optional[PeeringSelector] = None + """ + Selector for a NetworkPeering in compute to populate peering. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. + IPv4 special-use ranges are always exported to peers and + are not controlled by this field. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/networks/{{network}}/networkPeerings/{{peering}} + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes to the peer network. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. + IPv4 special-use ranges are always imported from peers and + are not controlled by this field. + """ + network: Optional[str] = None + """ + The name of the primary network for the peering. + """ + peering: Optional[str] = None + """ + Name of the peering. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkPeeringRoutesConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkPeeringRoutesConfig']] = 'NetworkPeeringRoutesConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkPeeringRoutesConfigSpec defines the desired state of NetworkPeeringRoutesConfig + """ + status: Optional[Status] = None + """ + NetworkPeeringRoutesConfigStatus defines the observed state of NetworkPeeringRoutesConfig. + """ + + +class NetworkPeeringRoutesConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkPeeringRoutesConfig] + """ + List of networkpeeringroutesconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/nodegroup/__init__.py b/schemas/python/models/io/upbound/gcp/compute/nodegroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta1.py new file mode 100644 index 000000000..02c93a8a4 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta1.py @@ -0,0 +1,516 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_nodegroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AutoscalingPolicyItem(BaseModel): + maxNodes: Optional[float] = None + """ + Maximum size of the node group. Set to a value less than or equal + to 100 and greater than or equal to min-nodes. + """ + minNodes: Optional[float] = None + """ + Minimum size of the node group. Must be less + than or equal to max-nodes. The default value is 0. + """ + mode: Optional[str] = None + """ + The autoscaling mode. Set to one of the following: + """ + + +class MaintenanceWindowItem(BaseModel): + startTime: Optional[str] = None + """ + instances.start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NodeTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NodeTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class IdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectMapItem(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + idRef: Optional[IdRef] = None + """ + Reference to a Project in cloudplatform to populate id. + """ + idSelector: Optional[IdSelector] = None + """ + Selector for a Project in cloudplatform to populate id. + """ + projectId: Optional[str] = None + """ + The project id/number should be the same as the key of this project config in the project map. + """ + projectIdRef: Optional[ProjectIdRef] = None + """ + Reference to a Project in cloudplatform to populate projectId. + """ + projectIdSelector: Optional[ProjectIdSelector] = None + """ + Selector for a Project in cloudplatform to populate projectId. + """ + + +class ShareSetting(BaseModel): + projectMap: Optional[List[ProjectMapItem]] = None + """ + A map of project id and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. + Structure is documented below. + """ + shareType: Optional[str] = None + """ + Node group sharing type. + Possible values are: ORGANIZATION, SPECIFIC_PROJECTS, LOCAL. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[List[MaintenanceWindowItem]] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + nodeTemplateRef: Optional[NodeTemplateRef] = None + """ + Reference to a NodeTemplate in compute to populate nodeTemplate. + """ + nodeTemplateSelector: Optional[NodeTemplateSelector] = None + """ + Selector for a NodeTemplate in compute to populate nodeTemplate. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shareSettings: Optional[List[ShareSetting]] = None + """ + Share settings for the node group. + Structure is documented below. + """ + zone: str + """ + Zone where this node group is located + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[List[MaintenanceWindowItem]] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + nodeTemplateRef: Optional[NodeTemplateRef] = None + """ + Reference to a NodeTemplate in compute to populate nodeTemplate. + """ + nodeTemplateSelector: Optional[NodeTemplateSelector] = None + """ + Selector for a NodeTemplate in compute to populate nodeTemplate. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shareSettings: Optional[List[ShareSetting]] = None + """ + Share settings for the node group. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ProjectMapItemModel(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + projectId: Optional[str] = None + """ + The project id/number should be the same as the key of this project config in the project map. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}} + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[List[MaintenanceWindowItem]] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shareSettings: Optional[List[ShareSetting]] = None + """ + Share settings for the node group. + Structure is documented below. + """ + size: Optional[float] = None + """ + The total number of nodes in the node group. + """ + zone: Optional[str] = None + """ + Zone where this node group is located + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodeGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NodeGroup']] = 'NodeGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodeGroupSpec defines the desired state of NodeGroup + """ + status: Optional[Status] = None + """ + NodeGroupStatus defines the observed state of NodeGroup. + """ + + +class NodeGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodeGroup] + """ + List of nodegroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta2.py new file mode 100644 index 000000000..193c549c3 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/nodegroup/v1beta2.py @@ -0,0 +1,516 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_nodegroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AutoscalingPolicy(BaseModel): + maxNodes: Optional[float] = None + """ + Maximum size of the node group. Set to a value less than or equal + to 100 and greater than or equal to min-nodes. + """ + minNodes: Optional[float] = None + """ + Minimum size of the node group. Must be less + than or equal to max-nodes. The default value is 0. + """ + mode: Optional[str] = None + """ + The autoscaling mode. Set to one of the following: + """ + + +class MaintenanceWindow(BaseModel): + startTime: Optional[str] = None + """ + instances.start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NodeTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NodeTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class IdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectMapItem(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + idRef: Optional[IdRef] = None + """ + Reference to a Project in cloudplatform to populate id. + """ + idSelector: Optional[IdSelector] = None + """ + Selector for a Project in cloudplatform to populate id. + """ + projectId: Optional[str] = None + """ + The project id/number should be the same as the key of this project config in the project map. + """ + projectIdRef: Optional[ProjectIdRef] = None + """ + Reference to a Project in cloudplatform to populate projectId. + """ + projectIdSelector: Optional[ProjectIdSelector] = None + """ + Selector for a Project in cloudplatform to populate projectId. + """ + + +class ShareSettings(BaseModel): + projectMap: Optional[List[ProjectMapItem]] = None + """ + A map of project id and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. + Structure is documented below. + """ + shareType: Optional[str] = None + """ + Node group sharing type. + Possible values are: ORGANIZATION, SPECIFIC_PROJECTS, LOCAL. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[MaintenanceWindow] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + nodeTemplateRef: Optional[NodeTemplateRef] = None + """ + Reference to a NodeTemplate in compute to populate nodeTemplate. + """ + nodeTemplateSelector: Optional[NodeTemplateSelector] = None + """ + Selector for a NodeTemplate in compute to populate nodeTemplate. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shareSettings: Optional[ShareSettings] = None + """ + Share settings for the node group. + Structure is documented below. + """ + zone: str + """ + Zone where this node group is located + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[MaintenanceWindow] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + nodeTemplateRef: Optional[NodeTemplateRef] = None + """ + Reference to a NodeTemplate in compute to populate nodeTemplate. + """ + nodeTemplateSelector: Optional[NodeTemplateSelector] = None + """ + Selector for a NodeTemplate in compute to populate nodeTemplate. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shareSettings: Optional[ShareSettings] = None + """ + Share settings for the node group. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ProjectMapItemModel(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + projectId: Optional[str] = None + """ + The project id/number should be the same as the key of this project config in the project map. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}} + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[MaintenanceWindow] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shareSettings: Optional[ShareSettings] = None + """ + Share settings for the node group. + Structure is documented below. + """ + size: Optional[float] = None + """ + The total number of nodes in the node group. + """ + zone: Optional[str] = None + """ + Zone where this node group is located + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodeGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['NodeGroup']] = 'NodeGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodeGroupSpec defines the desired state of NodeGroup + """ + status: Optional[Status] = None + """ + NodeGroupStatus defines the observed state of NodeGroup. + """ + + +class NodeGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodeGroup] + """ + List of nodegroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/nodetemplate/__init__.py b/schemas/python/models/io/upbound/gcp/compute/nodetemplate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta1.py new file mode 100644 index 000000000..d6bd8ed08 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta1.py @@ -0,0 +1,454 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_nodetemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Accelerator(BaseModel): + acceleratorCount: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this + node template. + """ + acceleratorType: Optional[str] = None + """ + Full or partial URL of the accelerator type resource to expose + to this node template. + """ + + +class Disk(BaseModel): + diskCount: Optional[float] = None + """ + Specifies the number of such disks. + """ + diskSizeGb: Optional[float] = None + """ + Specifies the size of the disk in base-2 GB. + """ + diskType: Optional[str] = None + """ + Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + """ + + +class NodeTypeFlexibilityItem(BaseModel): + cpus: Optional[str] = None + """ + Number of virtual CPUs to use. + """ + memory: Optional[str] = None + """ + Physical memory available to the node, defined in MB. + """ + + +class ServerBindingItem(BaseModel): + type: Optional[str] = None + """ + Type of server binding policy. If RESTART_NODE_ON_ANY_SERVER, + nodes using this template will restart on any physical server + following a maintenance event. + If RESTART_NODE_ON_MINIMAL_SERVER, nodes using this template + will restart on the same physical server following a maintenance + event, instead of being live migrated to or restarted on a new + physical server. This option may be useful if you are using + software licenses tied to the underlying server characteristics + such as physical sockets or cores, to avoid the need for + additional licenses when maintenance occurs. However, VMs on such + nodes will experience outages while maintenance is applied. + Possible values are: RESTART_NODE_ON_ANY_SERVER, RESTART_NODE_ON_MINIMAL_SERVERS. + """ + + +class ForProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[List[NodeTypeFlexibilityItem]] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where nodes using the node template will be created. + If it is not provided, the provider region is used. + """ + serverBinding: Optional[List[ServerBindingItem]] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[List[NodeTypeFlexibilityItem]] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + serverBinding: Optional[List[ServerBindingItem]] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class NodeTypeFlexibilityItemModel(BaseModel): + cpus: Optional[str] = None + """ + Number of virtual CPUs to use. + """ + localSsd: Optional[str] = None + """ + (Output) + Use local SSD + """ + memory: Optional[str] = None + """ + Physical memory available to the node, defined in MB. + """ + + +class AtProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}} + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[List[NodeTypeFlexibilityItemModel]] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where nodes using the node template will be created. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serverBinding: Optional[List[ServerBindingItem]] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodeTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NodeTemplate']] = 'NodeTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodeTemplateSpec defines the desired state of NodeTemplate + """ + status: Optional[Status] = None + """ + NodeTemplateStatus defines the observed state of NodeTemplate. + """ + + +class NodeTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodeTemplate] + """ + List of nodetemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta2.py new file mode 100644 index 000000000..34260e0c8 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/nodetemplate/v1beta2.py @@ -0,0 +1,454 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_nodetemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Accelerator(BaseModel): + acceleratorCount: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this + node template. + """ + acceleratorType: Optional[str] = None + """ + Full or partial URL of the accelerator type resource to expose + to this node template. + """ + + +class Disk(BaseModel): + diskCount: Optional[float] = None + """ + Specifies the number of such disks. + """ + diskSizeGb: Optional[float] = None + """ + Specifies the size of the disk in base-2 GB. + """ + diskType: Optional[str] = None + """ + Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + """ + + +class NodeTypeFlexibility(BaseModel): + cpus: Optional[str] = None + """ + Number of virtual CPUs to use. + """ + memory: Optional[str] = None + """ + Physical memory available to the node, defined in MB. + """ + + +class ServerBinding(BaseModel): + type: Optional[str] = None + """ + Type of server binding policy. If RESTART_NODE_ON_ANY_SERVER, + nodes using this template will restart on any physical server + following a maintenance event. + If RESTART_NODE_ON_MINIMAL_SERVER, nodes using this template + will restart on the same physical server following a maintenance + event, instead of being live migrated to or restarted on a new + physical server. This option may be useful if you are using + software licenses tied to the underlying server characteristics + such as physical sockets or cores, to avoid the need for + additional licenses when maintenance occurs. However, VMs on such + nodes will experience outages while maintenance is applied. + Possible values are: RESTART_NODE_ON_ANY_SERVER, RESTART_NODE_ON_MINIMAL_SERVERS. + """ + + +class ForProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[NodeTypeFlexibility] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where nodes using the node template will be created. + If it is not provided, the provider region is used. + """ + serverBinding: Optional[ServerBinding] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[NodeTypeFlexibility] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + serverBinding: Optional[ServerBinding] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class NodeTypeFlexibilityModel(BaseModel): + cpus: Optional[str] = None + """ + Number of virtual CPUs to use. + """ + localSsd: Optional[str] = None + """ + (Output) + Use local SSD + """ + memory: Optional[str] = None + """ + Physical memory available to the node, defined in MB. + """ + + +class AtProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}} + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[NodeTypeFlexibilityModel] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where nodes using the node template will be created. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serverBinding: Optional[ServerBinding] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodeTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['NodeTemplate']] = 'NodeTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodeTemplateSpec defines the desired state of NodeTemplate + """ + status: Optional[Status] = None + """ + NodeTemplateStatus defines the observed state of NodeTemplate. + """ + + +class NodeTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodeTemplate] + """ + List of nodetemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/packetmirroring/__init__.py b/schemas/python/models/io/upbound/gcp/compute/packetmirroring/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta1.py new file mode 100644 index 000000000..4afea59e0 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta1.py @@ -0,0 +1,475 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_packetmirroring.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CollectorIlbItem(BaseModel): + url: Optional[str] = None + """ + The URL of the forwarding rule. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a ForwardingRule in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a ForwardingRule in compute to populate url. + """ + + +class FilterItem(BaseModel): + cidrRanges: Optional[List[str]] = None + """ + IP CIDR ranges that apply as a filter on the source (ingress) or + destination (egress) IP in the IP header. Only IPv4 is supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to mirror. + Default value is BOTH. + Possible values are: INGRESS, EGRESS, BOTH. + """ + ipProtocols: Optional[List[str]] = None + """ + Possible IP protocols including tcp, udp, icmp and esp + """ + + +class Instance(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a Instance in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a Instance in compute to populate url. + """ + + +class Subnetwork(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + + +class MirroredResource(BaseModel): + instances: Optional[List[Instance]] = None + """ + All the listed instances will be mirrored. Specify at most 50. + Structure is documented below. + """ + subnetworks: Optional[List[Subnetwork]] = None + """ + All instances in one of these subnetworks will be mirrored. + Structure is documented below. + """ + tags: Optional[List[str]] = None + """ + All instances with these tags will be mirrored. + """ + + +class NetworkItem(BaseModel): + url: Optional[str] = None + """ + The full self_link URL of the network where this rule is active. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a Network in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a Network in compute to populate url. + """ + + +class ForProvider(BaseModel): + collectorIlb: Optional[List[CollectorIlbItem]] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[List[FilterItem]] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + mirroredResources: Optional[List[MirroredResource]] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[List[NetworkItem]] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + + +class InitProvider(BaseModel): + collectorIlb: Optional[List[CollectorIlbItem]] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[List[FilterItem]] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + mirroredResources: Optional[List[MirroredResource]] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[List[NetworkItem]] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CollectorIlbItemModel(BaseModel): + url: Optional[str] = None + """ + The URL of the forwarding rule. + """ + + +class InstanceModel(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + + +class NetworkItemModel(BaseModel): + url: Optional[str] = None + """ + The full self_link URL of the network where this rule is active. + """ + + +class AtProvider(BaseModel): + collectorIlb: Optional[List[CollectorIlbItemModel]] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[List[FilterItem]] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/packetMirrorings/{{name}} + """ + mirroredResources: Optional[List[MirroredResource]] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[List[NetworkItemModel]] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class PacketMirroring(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['PacketMirroring']] = 'PacketMirroring' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + PacketMirroringSpec defines the desired state of PacketMirroring + """ + status: Optional[Status] = None + """ + PacketMirroringStatus defines the observed state of PacketMirroring. + """ + + +class PacketMirroringList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[PacketMirroring] + """ + List of packetmirrorings. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta2.py new file mode 100644 index 000000000..381ef5d28 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/packetmirroring/v1beta2.py @@ -0,0 +1,475 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_packetmirroring.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CollectorIlb(BaseModel): + url: Optional[str] = None + """ + The URL of the forwarding rule. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a ForwardingRule in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a ForwardingRule in compute to populate url. + """ + + +class Filter(BaseModel): + cidrRanges: Optional[List[str]] = None + """ + IP CIDR ranges that apply as a filter on the source (ingress) or + destination (egress) IP in the IP header. Only IPv4 is supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to mirror. + Default value is BOTH. + Possible values are: INGRESS, EGRESS, BOTH. + """ + ipProtocols: Optional[List[str]] = None + """ + Possible IP protocols including tcp, udp, icmp and esp + """ + + +class Instance(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a Instance in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a Instance in compute to populate url. + """ + + +class Subnetwork(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + + +class MirroredResources(BaseModel): + instances: Optional[List[Instance]] = None + """ + All the listed instances will be mirrored. Specify at most 50. + Structure is documented below. + """ + subnetworks: Optional[List[Subnetwork]] = None + """ + All instances in one of these subnetworks will be mirrored. + Structure is documented below. + """ + tags: Optional[List[str]] = None + """ + All instances with these tags will be mirrored. + """ + + +class Network(BaseModel): + url: Optional[str] = None + """ + The full self_link URL of the network where this rule is active. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a Network in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a Network in compute to populate url. + """ + + +class ForProvider(BaseModel): + collectorIlb: Optional[CollectorIlb] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[Filter] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + mirroredResources: Optional[MirroredResources] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[Network] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + + +class InitProvider(BaseModel): + collectorIlb: Optional[CollectorIlb] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[Filter] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + mirroredResources: Optional[MirroredResources] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[Network] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CollectorIlbModel(BaseModel): + url: Optional[str] = None + """ + The URL of the forwarding rule. + """ + + +class InstanceModel(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + + +class NetworkModel(BaseModel): + url: Optional[str] = None + """ + The full self_link URL of the network where this rule is active. + """ + + +class AtProvider(BaseModel): + collectorIlb: Optional[CollectorIlbModel] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[Filter] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/packetMirrorings/{{name}} + """ + mirroredResources: Optional[MirroredResources] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[NetworkModel] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class PacketMirroring(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['PacketMirroring']] = 'PacketMirroring' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + PacketMirroringSpec defines the desired state of PacketMirroring + """ + status: Optional[Status] = None + """ + PacketMirroringStatus defines the observed state of PacketMirroring. + """ + + +class PacketMirroringList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[PacketMirroring] + """ + List of packetmirrorings. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/__init__.py b/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta1.py new file mode 100644 index 000000000..2fa19059d --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta1.py @@ -0,0 +1,581 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_perinstanceconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceGroupManagerRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceGroupManagerSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + + +class IpAddres(BaseModel): + address: Optional[str] = None + """ + The URL of the reservation for this IP address. + """ + + +class ExternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[List[IpAddres]] = None + """ + Ip address representation + Structure is documented below. + """ + + +class InternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[List[IpAddres]] = None + """ + Ip address representation + Structure is documented below. + """ + + +class PreservedStateItem(BaseModel): + disk: Optional[List[DiskItem]] = None + """ + Stateful disks for the instance. + Structure is documented below. + """ + externalIp: Optional[List[ExternalIpItem]] = None + """ + Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + internalIp: Optional[List[InternalIpItem]] = None + """ + Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + metadata: Optional[Dict[str, str]] = None + """ + Preserved metadata defined for this instance. This is a list of key->value pairs. + """ + + +class ZoneRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ZoneSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + instanceGroupManagerRef: Optional[InstanceGroupManagerRef] = None + """ + Reference to a InstanceGroupManager in compute to populate instanceGroupManager. + """ + instanceGroupManagerSelector: Optional[InstanceGroupManagerSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate instanceGroupManager. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[List[PreservedStateItem]] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + zoneRef: Optional[ZoneRef] = None + """ + Reference to a InstanceGroupManager in compute to populate zone. + """ + zoneSelector: Optional[ZoneSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate zone. + """ + + +class InitProvider(BaseModel): + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + instanceGroupManagerRef: Optional[InstanceGroupManagerRef] = None + """ + Reference to a InstanceGroupManager in compute to populate instanceGroupManager. + """ + instanceGroupManagerSelector: Optional[InstanceGroupManagerSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate instanceGroupManager. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[List[PreservedStateItem]] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + zoneRef: Optional[ZoneRef] = None + """ + Reference to a InstanceGroupManager in compute to populate zone. + """ + zoneSelector: Optional[ZoneSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate zone. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DiskItemModel(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{zone}}/{{instance_group_manager}}/{{name}} + """ + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[List[PreservedStateItem]] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class PerInstanceConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['PerInstanceConfig']] = 'PerInstanceConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + PerInstanceConfigSpec defines the desired state of PerInstanceConfig + """ + status: Optional[Status] = None + """ + PerInstanceConfigStatus defines the observed state of PerInstanceConfig. + """ + + +class PerInstanceConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[PerInstanceConfig] + """ + List of perinstanceconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta2.py new file mode 100644 index 000000000..d92ba85e1 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/perinstanceconfig/v1beta2.py @@ -0,0 +1,581 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_perinstanceconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceGroupManagerRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceGroupManagerSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + + +class IpAddress(BaseModel): + address: Optional[str] = None + """ + The URL of the reservation for this IP address. + """ + + +class ExternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class InternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class PreservedState(BaseModel): + disk: Optional[List[DiskItem]] = None + """ + Stateful disks for the instance. + Structure is documented below. + """ + externalIp: Optional[List[ExternalIpItem]] = None + """ + Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + internalIp: Optional[List[InternalIpItem]] = None + """ + Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + metadata: Optional[Dict[str, str]] = None + """ + Preserved metadata defined for this instance. This is a list of key->value pairs. + """ + + +class ZoneRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ZoneSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + instanceGroupManagerRef: Optional[InstanceGroupManagerRef] = None + """ + Reference to a InstanceGroupManager in compute to populate instanceGroupManager. + """ + instanceGroupManagerSelector: Optional[InstanceGroupManagerSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate instanceGroupManager. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + zoneRef: Optional[ZoneRef] = None + """ + Reference to a InstanceGroupManager in compute to populate zone. + """ + zoneSelector: Optional[ZoneSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate zone. + """ + + +class InitProvider(BaseModel): + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + instanceGroupManagerRef: Optional[InstanceGroupManagerRef] = None + """ + Reference to a InstanceGroupManager in compute to populate instanceGroupManager. + """ + instanceGroupManagerSelector: Optional[InstanceGroupManagerSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate instanceGroupManager. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + zoneRef: Optional[ZoneRef] = None + """ + Reference to a InstanceGroupManager in compute to populate zone. + """ + zoneSelector: Optional[ZoneSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate zone. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DiskItemModel(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{zone}}/{{instance_group_manager}}/{{name}} + """ + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class PerInstanceConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['PerInstanceConfig']] = 'PerInstanceConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + PerInstanceConfigSpec defines the desired state of PerInstanceConfig + """ + status: Optional[Status] = None + """ + PerInstanceConfigStatus defines the observed state of PerInstanceConfig. + """ + + +class PerInstanceConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[PerInstanceConfig] + """ + List of perinstanceconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/projectdefaultnetworktier/__init__.py b/schemas/python/models/io/upbound/gcp/compute/projectdefaultnetworktier/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/projectdefaultnetworktier/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/projectdefaultnetworktier/v1beta1.py new file mode 100644 index 000000000..9413e4490 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/projectdefaultnetworktier/v1beta1.py @@ -0,0 +1,240 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_projectdefaultnetworktier.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + networkTier: Optional[str] = None + """ + The default network tier to be configured for the project. + This field can take the following values: PREMIUM or STANDARD. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + networkTier: Optional[str] = None + """ + The default network tier to be configured for the project. + This field can take the following values: PREMIUM or STANDARD. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}} + """ + networkTier: Optional[str] = None + """ + The default network tier to be configured for the project. + This field can take the following values: PREMIUM or STANDARD. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectDefaultNetworkTier(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectDefaultNetworkTier']] = 'ProjectDefaultNetworkTier' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectDefaultNetworkTierSpec defines the desired state of ProjectDefaultNetworkTier + """ + status: Optional[Status] = None + """ + ProjectDefaultNetworkTierStatus defines the observed state of ProjectDefaultNetworkTier. + """ + + +class ProjectDefaultNetworkTierList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectDefaultNetworkTier] + """ + List of projectdefaultnetworktiers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/projectmetadata/__init__.py b/schemas/python/models/io/upbound/gcp/compute/projectmetadata/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/projectmetadata/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/projectmetadata/v1beta1.py new file mode 100644 index 000000000..34b820f78 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/projectmetadata/v1beta1.py @@ -0,0 +1,237 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_projectmetadata.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + metadata: Optional[Dict[str, str]] = None + """ + A series of key value pairs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + metadata: Optional[Dict[str, str]] = None + """ + A series of key value pairs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}} + """ + metadata: Optional[Dict[str, str]] = None + """ + A series of key value pairs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectMetadata(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectMetadata']] = 'ProjectMetadata' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectMetadataSpec defines the desired state of ProjectMetadata + """ + status: Optional[Status] = None + """ + ProjectMetadataStatus defines the observed state of ProjectMetadata. + """ + + +class ProjectMetadataList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectMetadata] + """ + List of projectmetadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/projectmetadataitem/__init__.py b/schemas/python/models/io/upbound/gcp/compute/projectmetadataitem/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/projectmetadataitem/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/projectmetadataitem/v1beta1.py new file mode 100644 index 000000000..1acf81a95 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/projectmetadataitem/v1beta1.py @@ -0,0 +1,249 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_projectmetadataitem.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + key: Optional[str] = None + """ + The metadata key to set. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + value: Optional[str] = None + """ + The value to set for the given metadata key. + """ + + +class InitProvider(BaseModel): + key: Optional[str] = None + """ + The metadata key to set. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + value: Optional[str] = None + """ + The value to set for the given metadata key. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format `{{key}}` + """ + key: Optional[str] = None + """ + The metadata key to set. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + value: Optional[str] = None + """ + The value to set for the given metadata key. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectMetadataItem(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectMetadataItem']] = 'ProjectMetadataItem' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectMetadataItemSpec defines the desired state of ProjectMetadataItem + """ + status: Optional[Status] = None + """ + ProjectMetadataItemStatus defines the observed state of ProjectMetadataItem. + """ + + +class ProjectMetadataItemList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectMetadataItem] + """ + List of projectmetadataitems. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta1.py new file mode 100644 index 000000000..b4054e0f5 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta1.py @@ -0,0 +1,535 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionautoscaler.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CpuUtilizationItem(BaseModel): + predictiveMethod: Optional[str] = None + """ + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class LoadBalancingUtilizationItem(BaseModel): + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class MetricItem(BaseModel): + filter: Optional[str] = None + """ + A filter string to be used as the filter string for + a Stackdriver Monitoring TimeSeries.list API call. + This filter is used to select a specific TimeSeries for + the purpose of autoscaling and to determine whether the metric + is exporting per-instance or per-group data. + You can only use the AND operator for joining selectors. + You can only use direct equality comparison operator (=) without + any functions for each selector. + You can specify the metric in both the filter string and in the + metric field. However, if specified in both places, the metric must + be identical. + The monitored resource type determines what kind of values are + expected for the metric. If it is a gce_instance, the autoscaler + expects the metric to include a separate TimeSeries for each + instance in a group. In such a case, you cannot filter on resource + labels. + If the resource type is any other value, the autoscaler expects + this metric to contain values that apply to the entire autoscaled + instance group and resource label filtering can be performed to + point autoscaler at the correct TimeSeries to scale upon. + This is called a per-group metric for the purpose of autoscaling. + If not specified, the type defaults to gce_instance. + You should provide a filter that is selective enough to pick just + one TimeSeries for the autoscaled group or for each of the instances + (if you are using gce_instance resource type). If multiple + TimeSeries are returned upon the query execution, the autoscaler + will sum their respective values to obtain its scaling value. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + singleInstanceAssignment: Optional[float] = None + """ + If scaling is based on a per-group metric value that represents the + total amount of work to be done or resource usage, set this value to + an amount assigned for a single instance of the scaled group. + The autoscaler will keep the number of instances proportional to the + value of this metric, the metric itself should not change value due + to group resizing. + For example, a good metric to use with the target is + pubsub.googleapis.com/subscription/num_undelivered_messages + or a custom metric exporting the total number of requests coming to + your instances. + A bad example would be a metric exporting an average or median + latency, since this value can't include a chunk assignable to a + single instance, it could be better used with utilization_target + instead. + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + type: Optional[str] = None + """ + Defines how target utilization value is expressed for a + Stackdriver Monitoring metric. + Possible values are: GAUGE, DELTA_PER_SECOND, DELTA_PER_MINUTE. + """ + + +class MaxScaledInReplica(BaseModel): + fixed: Optional[float] = None + """ + Specifies a fixed number of VM instances. This must be a positive + integer. + """ + percent: Optional[float] = None + """ + Specifies a percentage of instances between 0 to 100%, inclusive. + For example, specify 80 for 80%. + """ + + +class ScaleInControlItem(BaseModel): + maxScaledInReplicas: Optional[List[MaxScaledInReplica]] = None + """ + A nested object resource + Structure is documented below. + """ + timeWindowSec: Optional[float] = None + """ + How long back autoscaling should look when computing recommendations + to include directives regarding slower scale down, as described above. + """ + + +class ScalingSchedule(BaseModel): + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + disabled: Optional[bool] = None + """ + A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. + """ + durationSec: Optional[float] = None + """ + The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. + """ + minRequiredReplicas: Optional[float] = None + """ + Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + schedule: Optional[str] = None + """ + The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). + """ + timeZone: Optional[str] = None + """ + The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + + +class AutoscalingPolicyItem(BaseModel): + cooldownPeriod: Optional[float] = None + """ + The number of seconds that the autoscaler should wait before it + starts collecting information from a new instance. This prevents + the autoscaler from collecting information when the instance is + initializing, during which the collected usage would not be + reliable. The default time autoscaler waits is 60 seconds. + Virtual machine initialization times might vary because of + numerous factors. We recommend that you test how long an + instance may take to initialize. To do this, create an instance + and time the startup process. + """ + cpuUtilization: Optional[List[CpuUtilizationItem]] = None + """ + Defines the CPU utilization policy that allows the autoscaler to + scale based on the average CPU utilization of a managed instance + group. + Structure is documented below. + """ + loadBalancingUtilization: Optional[List[LoadBalancingUtilizationItem]] = None + """ + Configuration parameters of autoscaling based on a load balancer. + Structure is documented below. + """ + maxReplicas: Optional[float] = None + """ + The maximum number of instances that the autoscaler can scale up + to. This is required when creating or updating an autoscaler. The + maximum number of replicas should not be lower than minimal number + of replicas. + """ + metric: Optional[List[MetricItem]] = None + """ + Configuration parameters of autoscaling based on a custom metric. + Structure is documented below. + """ + minReplicas: Optional[float] = None + """ + The minimum number of replicas that the autoscaler can scale down + to. This cannot be less than 0. If not provided, autoscaler will + choose a default value depending on maximum number of instances + allowed. + """ + mode: Optional[str] = None + """ + Defines operating mode for this policy. + """ + scaleInControl: Optional[List[ScaleInControlItem]] = None + """ + Defines scale in controls to reduce the risk of response latency + and outages due to abrupt scale-in events + Structure is documented below. + """ + scalingSchedules: Optional[List[ScalingSchedule]] = None + """ + Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + URL of the region where the instance group resides. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate target. + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[List[AutoscalingPolicyItem]] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/autoscalers/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + URL of the region where the instance group resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionAutoscaler(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionAutoscaler']] = 'RegionAutoscaler' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionAutoscalerSpec defines the desired state of RegionAutoscaler + """ + status: Optional[Status] = None + """ + RegionAutoscalerStatus defines the observed state of RegionAutoscaler. + """ + + +class RegionAutoscalerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionAutoscaler] + """ + List of regionautoscalers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta2.py new file mode 100644 index 000000000..23971ca16 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionautoscaler/v1beta2.py @@ -0,0 +1,535 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regionautoscaler.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CpuUtilization(BaseModel): + predictiveMethod: Optional[str] = None + """ + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class LoadBalancingUtilization(BaseModel): + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class MetricItem(BaseModel): + filter: Optional[str] = None + """ + A filter string to be used as the filter string for + a Stackdriver Monitoring TimeSeries.list API call. + This filter is used to select a specific TimeSeries for + the purpose of autoscaling and to determine whether the metric + is exporting per-instance or per-group data. + You can only use the AND operator for joining selectors. + You can only use direct equality comparison operator (=) without + any functions for each selector. + You can specify the metric in both the filter string and in the + metric field. However, if specified in both places, the metric must + be identical. + The monitored resource type determines what kind of values are + expected for the metric. If it is a gce_instance, the autoscaler + expects the metric to include a separate TimeSeries for each + instance in a group. In such a case, you cannot filter on resource + labels. + If the resource type is any other value, the autoscaler expects + this metric to contain values that apply to the entire autoscaled + instance group and resource label filtering can be performed to + point autoscaler at the correct TimeSeries to scale upon. + This is called a per-group metric for the purpose of autoscaling. + If not specified, the type defaults to gce_instance. + You should provide a filter that is selective enough to pick just + one TimeSeries for the autoscaled group or for each of the instances + (if you are using gce_instance resource type). If multiple + TimeSeries are returned upon the query execution, the autoscaler + will sum their respective values to obtain its scaling value. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + singleInstanceAssignment: Optional[float] = None + """ + If scaling is based on a per-group metric value that represents the + total amount of work to be done or resource usage, set this value to + an amount assigned for a single instance of the scaled group. + The autoscaler will keep the number of instances proportional to the + value of this metric, the metric itself should not change value due + to group resizing. + For example, a good metric to use with the target is + pubsub.googleapis.com/subscription/num_undelivered_messages + or a custom metric exporting the total number of requests coming to + your instances. + A bad example would be a metric exporting an average or median + latency, since this value can't include a chunk assignable to a + single instance, it could be better used with utilization_target + instead. + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + type: Optional[str] = None + """ + Defines how target utilization value is expressed for a + Stackdriver Monitoring metric. + Possible values are: GAUGE, DELTA_PER_SECOND, DELTA_PER_MINUTE. + """ + + +class MaxScaledInReplicas(BaseModel): + fixed: Optional[float] = None + """ + Specifies a fixed number of VM instances. This must be a positive + integer. + """ + percent: Optional[float] = None + """ + Specifies a percentage of instances between 0 to 100%, inclusive. + For example, specify 80 for 80%. + """ + + +class ScaleInControl(BaseModel): + maxScaledInReplicas: Optional[MaxScaledInReplicas] = None + """ + A nested object resource. + Structure is documented below. + """ + timeWindowSec: Optional[float] = None + """ + How long back autoscaling should look when computing recommendations + to include directives regarding slower scale down, as described above. + """ + + +class ScalingSchedule(BaseModel): + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + disabled: Optional[bool] = None + """ + A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. + """ + durationSec: Optional[float] = None + """ + The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. + """ + minRequiredReplicas: Optional[float] = None + """ + Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + schedule: Optional[str] = None + """ + The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). + """ + timeZone: Optional[str] = None + """ + The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + + +class AutoscalingPolicy(BaseModel): + cooldownPeriod: Optional[float] = None + """ + The number of seconds that the autoscaler should wait before it + starts collecting information from a new instance. This prevents + the autoscaler from collecting information when the instance is + initializing, during which the collected usage would not be + reliable. The default time autoscaler waits is 60 seconds. + Virtual machine initialization times might vary because of + numerous factors. We recommend that you test how long an + instance may take to initialize. To do this, create an instance + and time the startup process. + """ + cpuUtilization: Optional[CpuUtilization] = None + """ + Defines the CPU utilization policy that allows the autoscaler to + scale based on the average CPU utilization of a managed instance + group. + Structure is documented below. + """ + loadBalancingUtilization: Optional[LoadBalancingUtilization] = None + """ + Configuration parameters of autoscaling based on a load balancer. + Structure is documented below. + """ + maxReplicas: Optional[float] = None + """ + The maximum number of instances that the autoscaler can scale up + to. This is required when creating or updating an autoscaler. The + maximum number of replicas should not be lower than minimal number + of replicas. + """ + metric: Optional[List[MetricItem]] = None + """ + Configuration parameters of autoscaling based on a custom metric. + Structure is documented below. + """ + minReplicas: Optional[float] = None + """ + The minimum number of replicas that the autoscaler can scale down + to. This cannot be less than 0. If not provided, autoscaler will + choose a default value depending on maximum number of instances + allowed. + """ + mode: Optional[str] = None + """ + Defines operating mode for this policy. + """ + scaleInControl: Optional[ScaleInControl] = None + """ + Defines scale in controls to reduce the risk of response latency + and outages due to abrupt scale-in events + Structure is documented below. + """ + scalingSchedules: Optional[List[ScalingSchedule]] = None + """ + Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + URL of the region where the instance group resides. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate target. + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/autoscalers/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + URL of the region where the instance group resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionAutoscaler(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionAutoscaler']] = 'RegionAutoscaler' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionAutoscalerSpec defines the desired state of RegionAutoscaler + """ + status: Optional[Status] = None + """ + RegionAutoscalerStatus defines the observed state of RegionAutoscaler. + """ + + +class RegionAutoscalerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionAutoscaler] + """ + List of regionautoscalers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta1.py new file mode 100644 index 000000000..806a8e3ea --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta1.py @@ -0,0 +1,1487 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionbackendservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CustomMetric(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BackendItem(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + ~>NOTE: This field cannot be set for + INTERNAL region backend services (default loadBalancingScheme), + but is required for non-INTERNAL backend service. The total + capacity_scaler for all backends must be non-zero. + A setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetric]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + failover: Optional[bool] = None + """ + This field designates whether this is a failover backend. More + than one failover backend can be configured for a given RegionBackendService. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + When the load_balancing_scheme is INTERNAL, only instance groups + are supported. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + groupRef: Optional[GroupRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate group. + """ + groupSelector: Optional[GroupSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate group. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + Cannot be set for INTERNAL backend services. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. Cannot be set + for INTERNAL backend services. + This is used to calculate the capacity of the group. Can be + used in either CONNECTION or UTILIZATION balancing modes. For + CONNECTION mode, either maxConnections or + maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. Cannot be set for INTERNAL backend + services. + This is used to calculate the capacity of the group. + Can be used in either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. Cannot be set + for INTERNAL backend services. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. Either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. Cannot be set + for INTERNAL backend services. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. Cannot be set + for INTERNAL backend services. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + Cannot be set for INTERNAL backend services. + """ + + +class CacheKeyPolicyItem(BaseModel): + includeHost: Optional[bool] = None + """ + If true requests to different hosts will be cached separately. + """ + includeNamedCookies: Optional[List[str]] = None + """ + Names of cookies to include in cache keys. + """ + includeProtocol: Optional[bool] = None + """ + If true, http and https requests will be cached separately. + """ + includeQueryString: Optional[bool] = None + """ + If true, include query string parameters in the cache key + according to query_string_whitelist and + query_string_blacklist. If neither is set, the entire query + string will be included. + If false, the query string will be excluded from the cache + key entirely. + """ + queryStringBlacklist: Optional[List[str]] = None + """ + Names of query string parameters to exclude in cache keys. + All other parameters will be included. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + All other parameters will be excluded. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + + +class CdnPolicyItem(BaseModel): + cacheKeyPolicy: Optional[List[CacheKeyPolicyItem]] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request + will be considered fresh, defaults to 1hr (3600s). After this + time period, the response will be revalidated before + being served. + When serving responses to signed URL requests, Cloud CDN will + internally behave as though all responses from this backend had a + "Cache-Control: public, max-age=[TTL]" header, regardless of any + existing Cache-Control header. The actual headers served in + responses will not be altered. + """ + + +class CircuitBreaker(BaseModel): + maxConnections: Optional[float] = None + """ + The maximum number of connections to the backend cluster. + Defaults to 1024. + """ + maxPendingRequests: Optional[float] = None + """ + The maximum number of pending requests to the backend cluster. + Defaults to 1024. + """ + maxRequests: Optional[float] = None + """ + The maximum number of parallel requests to the backend cluster. + Defaults to 1024. + """ + maxRequestsPerConnection: Optional[float] = None + """ + Maximum requests for a single backend connection. This parameter + is respected by both the HTTP/1.1 and HTTP/2 implementations. If + not specified, there is no limit. Setting this parameter to 1 + will effectively disable keep alive. + """ + maxRetries: Optional[float] = None + """ + The maximum number of parallel retries to the backend cluster. + Defaults to 3. + """ + + +class TtlItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class HttpCookieItem(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[List[TtlItem]] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ConsistentHashItem(BaseModel): + httpCookie: Optional[List[HttpCookieItem]] = None + """ + Hash is based on HTTP Cookie. This field describes a HTTP cookie + that will be used as the hash key for the consistent hash load + balancer. If the cookie is not present, it will be generated. + This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + Structure is documented below. + """ + httpHeaderName: Optional[str] = None + """ + The hash based on the value of the specified header field. + This field is applicable if the sessionAffinity is set to HEADER_FIELD. + """ + minimumRingSize: Optional[float] = None + """ + The minimum number of virtual nodes to use for the hash ring. + Larger ring sizes result in more granular load + distributions. If the number of hosts in the load balancing pool + is larger than the ring size, each host will be assigned a single + virtual node. + Defaults to 1024. + """ + + +class CustomMetricModel(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class FailoverPolicyItem(BaseModel): + disableConnectionDrainOnFailover: Optional[bool] = None + """ + On failover or failback, this field indicates whether connection drain + will be honored. Setting this to true has the following effect: connections + to the old active pool are not drained. Connections to the new active pool + use the timeout of 10 min (currently fixed). Setting to false has the + following effect: both old and new connections will have a drain timeout + of 10 min. + This can be set to true only if the protocol is TCP. + The default is false. + """ + dropTrafficIfUnhealthy: Optional[bool] = None + """ + This option is used only when no healthy VMs are detected in the primary + and backup instance groups. When set to true, traffic is dropped. When + set to false, new connections are sent across all VMs in the primary group. + The default is false. + """ + failoverRatio: Optional[float] = None + """ + The value of the field must be in [0, 1]. If the ratio of the healthy + VMs in the primary backend is at or below this number, traffic arriving + at the load-balanced IP will be directed to the failover backend. + In case where 'failoverRatio' is not set or all the VMs in the backup + backend are unhealthy, the traffic will be directed back to the primary + backend in the "force" mode, where traffic will be spread to the healthy + VMs with the best effort, or to all VMs when no VM is healthy. + This field is only used with l4 load balancing. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Oauth2ClientSecretSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class IapItem(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + oauth2ClientSecretSecretRef: Optional[Oauth2ClientSecretSecretRef] = None + """ + OAuth2 Client Secret for IAP + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class LogConfigItem(BaseModel): + enable: Optional[bool] = None + """ + Whether to enable logging for the load balancer traffic served by this backend service. + """ + optionalFields: Optional[List[str]] = None + """ + Specifies the fields to include in logging. This field can only be specified if logging is enabled for this backend service. + """ + optionalMode: Optional[str] = None + """ + Specifies the optional logging mode for the load balancer traffic. + Supported values: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + Possible values are: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + """ + sampleRate: Optional[float] = None + """ + This field can only be specified if logging is enabled for this backend service. The value of + the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer + where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. + The default value is 1.0. + """ + + +class BaseEjectionTimeItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class IntervalItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class OutlierDetectionItem(BaseModel): + baseEjectionTime: Optional[List[BaseEjectionTimeItem]] = None + """ + The base time that a host is ejected for. The real time is equal to the base + time multiplied by the number of times the host has been ejected. Defaults to + 30000ms or 30s. + Structure is documented below. + """ + consecutiveErrors: Optional[float] = None + """ + Number of errors before a host is ejected from the connection pool. When the + backend host is accessed over HTTP, a 5xx return code qualifies as an error. + Defaults to 5. + """ + consecutiveGatewayFailure: Optional[float] = None + """ + The number of consecutive gateway failures (502, 503, 504 status or connection + errors that are mapped to one of those status codes) before a consecutive + gateway failure ejection occurs. Defaults to 5. + """ + enforcingConsecutiveErrors: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive 5xx. This setting can be used to disable + ejection or to ramp it up slowly. Defaults to 100. + """ + enforcingConsecutiveGatewayFailure: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive gateway failures. This setting can be + used to disable ejection or to ramp it up slowly. Defaults to 0. + """ + enforcingSuccessRate: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through success rate statistics. This setting can be used to + disable ejection or to ramp it up slowly. Defaults to 100. + """ + interval: Optional[List[IntervalItem]] = None + """ + Time interval between ejection sweep analysis. This can result in both new + ejections as well as hosts being returned to service. Defaults to 10 seconds. + Structure is documented below. + """ + maxEjectionPercent: Optional[float] = None + """ + Maximum percentage of hosts in the load balancing pool for the backend service + that can be ejected. Defaults to 10%. + """ + successRateMinimumHosts: Optional[float] = None + """ + The number of hosts in a cluster that must have enough request volume to detect + success rate outliers. If the number of hosts is less than this setting, outlier + detection via success rate statistics is not performed for any host in the + cluster. Defaults to 5. + """ + successRateRequestVolume: Optional[float] = None + """ + The minimum number of total requests that must be collected in one interval (as + defined by the interval duration above) to include this host in success rate + based outlier detection. If the volume is lower than this setting, outlier + detection via success rate statistics is not performed for that host. Defaults + to 100. + """ + successRateStdevFactor: Optional[float] = None + """ + This factor is used to determine the ejection threshold for success rate outlier + ejection. The ejection threshold is the difference between the mean success + rate, and the product of this factor and the standard deviation of the mean + success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided + by a thousand to get a double. That is, if the desired factor is 1.9, the + runtime value should be 1900. Defaults to 1900. + """ + + +class StrongSessionAffinityCookieItem(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[List[TtlItem]] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ForProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[List[CircuitBreaker]] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[List[ConsistentHashItem]] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + customMetrics: Optional[List[CustomMetricModel]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[List[FailoverPolicyItem]] = None + """ + Policy for failovers. + Structure is documented below. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to RegionHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of RegionHealthCheck in compute to populate healthChecks. + """ + iap: Optional[List[IapItem]] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[List[OutlierDetectionItem]] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + region: str + """ + The Region in which the created backend service should reside. + If it is not provided, the provider region is used. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[List[StrongSessionAffinityCookieItem]] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class CustomMetricModel1(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class CustomMetricModel2(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class InitProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[List[CircuitBreaker]] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[List[ConsistentHashItem]] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + customMetrics: Optional[List[CustomMetricModel2]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[List[FailoverPolicyItem]] = None + """ + Policy for failovers. + Structure is documented below. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to RegionHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of RegionHealthCheck in compute to populate healthChecks. + """ + iap: Optional[List[IapItem]] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[List[OutlierDetectionItem]] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[List[StrongSessionAffinityCookieItem]] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CustomMetricModel3(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class BackendItemModel(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + ~>NOTE: This field cannot be set for + INTERNAL region backend services (default loadBalancingScheme), + but is required for non-INTERNAL backend service. The total + capacity_scaler for all backends must be non-zero. + A setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetricModel3]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + failover: Optional[bool] = None + """ + This field designates whether this is a failover backend. More + than one failover backend can be configured for a given RegionBackendService. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + When the load_balancing_scheme is INTERNAL, only instance groups + are supported. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + Cannot be set for INTERNAL backend services. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. Cannot be set + for INTERNAL backend services. + This is used to calculate the capacity of the group. Can be + used in either CONNECTION or UTILIZATION balancing modes. For + CONNECTION mode, either maxConnections or + maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. Cannot be set for INTERNAL backend + services. + This is used to calculate the capacity of the group. + Can be used in either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. Cannot be set + for INTERNAL backend services. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. Either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. Cannot be set + for INTERNAL backend services. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. Cannot be set + for INTERNAL backend services. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + Cannot be set for INTERNAL backend services. + """ + + +class CustomMetricModel4(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class IapItemModel(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + + +class AtProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItemModel]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[List[CdnPolicyItem]] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[List[CircuitBreaker]] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[List[ConsistentHashItem]] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customMetrics: Optional[List[CustomMetricModel4]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[List[FailoverPolicyItem]] = None + """ + Policy for failovers. + Structure is documented below. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + generatedId: Optional[float] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + iap: Optional[List[IapItemModel]] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/backendServices/{{name}} + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[List[OutlierDetectionItem]] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + region: Optional[str] = None + """ + The Region in which the created backend service should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[List[StrongSessionAffinityCookieItem]] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionBackendService(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionBackendService']] = 'RegionBackendService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionBackendServiceSpec defines the desired state of RegionBackendService + """ + status: Optional[Status] = None + """ + RegionBackendServiceStatus defines the observed state of RegionBackendService. + """ + + +class RegionBackendServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionBackendService] + """ + List of regionbackendservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta2.py new file mode 100644 index 000000000..783ca9054 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionbackendservice/v1beta2.py @@ -0,0 +1,1487 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regionbackendservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CustomMetric(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BackendItem(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + ~>NOTE: This field cannot be set for + INTERNAL region backend services (default loadBalancingScheme), + but is required for non-INTERNAL backend service. The total + capacity_scaler for all backends must be non-zero. + A setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetric]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + failover: Optional[bool] = None + """ + This field designates whether this is a failover backend. More + than one failover backend can be configured for a given RegionBackendService. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + When the load_balancing_scheme is INTERNAL, only instance groups + are supported. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + groupRef: Optional[GroupRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate group. + """ + groupSelector: Optional[GroupSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate group. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + Cannot be set for INTERNAL backend services. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. Cannot be set + for INTERNAL backend services. + This is used to calculate the capacity of the group. Can be + used in either CONNECTION or UTILIZATION balancing modes. For + CONNECTION mode, either maxConnections or + maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. Cannot be set for INTERNAL backend + services. + This is used to calculate the capacity of the group. + Can be used in either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. Cannot be set + for INTERNAL backend services. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. Either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. Cannot be set + for INTERNAL backend services. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. Cannot be set + for INTERNAL backend services. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + Cannot be set for INTERNAL backend services. + """ + + +class CacheKeyPolicy(BaseModel): + includeHost: Optional[bool] = None + """ + If true requests to different hosts will be cached separately. + """ + includeNamedCookies: Optional[List[str]] = None + """ + Names of cookies to include in cache keys. + """ + includeProtocol: Optional[bool] = None + """ + If true, http and https requests will be cached separately. + """ + includeQueryString: Optional[bool] = None + """ + If true, include query string parameters in the cache key + according to query_string_whitelist and + query_string_blacklist. If neither is set, the entire query + string will be included. + If false, the query string will be excluded from the cache + key entirely. + """ + queryStringBlacklist: Optional[List[str]] = None + """ + Names of query string parameters to exclude in cache keys. + All other parameters will be included. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + All other parameters will be excluded. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + + +class CdnPolicy(BaseModel): + cacheKeyPolicy: Optional[CacheKeyPolicy] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request + will be considered fresh, defaults to 1hr (3600s). After this + time period, the response will be revalidated before + being served. + When serving responses to signed URL requests, Cloud CDN will + internally behave as though all responses from this backend had a + "Cache-Control: public, max-age=[TTL]" header, regardless of any + existing Cache-Control header. The actual headers served in + responses will not be altered. + """ + + +class CircuitBreakers(BaseModel): + maxConnections: Optional[float] = None + """ + The maximum number of connections to the backend cluster. + Defaults to 1024. + """ + maxPendingRequests: Optional[float] = None + """ + The maximum number of pending requests to the backend cluster. + Defaults to 1024. + """ + maxRequests: Optional[float] = None + """ + The maximum number of parallel requests to the backend cluster. + Defaults to 1024. + """ + maxRequestsPerConnection: Optional[float] = None + """ + Maximum requests for a single backend connection. This parameter + is respected by both the HTTP/1.1 and HTTP/2 implementations. If + not specified, there is no limit. Setting this parameter to 1 + will effectively disable keep alive. + """ + maxRetries: Optional[float] = None + """ + The maximum number of parallel retries to the backend cluster. + Defaults to 3. + """ + + +class Ttl(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class HttpCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ConsistentHash(BaseModel): + httpCookie: Optional[HttpCookie] = None + """ + Hash is based on HTTP Cookie. This field describes a HTTP cookie + that will be used as the hash key for the consistent hash load + balancer. If the cookie is not present, it will be generated. + This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + Structure is documented below. + """ + httpHeaderName: Optional[str] = None + """ + The hash based on the value of the specified header field. + This field is applicable if the sessionAffinity is set to HEADER_FIELD. + """ + minimumRingSize: Optional[float] = None + """ + The minimum number of virtual nodes to use for the hash ring. + Larger ring sizes result in more granular load + distributions. If the number of hosts in the load balancing pool + is larger than the ring size, each host will be assigned a single + virtual node. + Defaults to 1024. + """ + + +class CustomMetricModel(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class FailoverPolicy(BaseModel): + disableConnectionDrainOnFailover: Optional[bool] = None + """ + On failover or failback, this field indicates whether connection drain + will be honored. Setting this to true has the following effect: connections + to the old active pool are not drained. Connections to the new active pool + use the timeout of 10 min (currently fixed). Setting to false has the + following effect: both old and new connections will have a drain timeout + of 10 min. + This can be set to true only if the protocol is TCP. + The default is false. + """ + dropTrafficIfUnhealthy: Optional[bool] = None + """ + This option is used only when no healthy VMs are detected in the primary + and backup instance groups. When set to true, traffic is dropped. When + set to false, new connections are sent across all VMs in the primary group. + The default is false. + """ + failoverRatio: Optional[float] = None + """ + The value of the field must be in [0, 1]. If the ratio of the healthy + VMs in the primary backend is at or below this number, traffic arriving + at the load-balanced IP will be directed to the failover backend. + In case where 'failoverRatio' is not set or all the VMs in the backup + backend are unhealthy, the traffic will be directed back to the primary + backend in the "force" mode, where traffic will be spread to the healthy + VMs with the best effort, or to all VMs when no VM is healthy. + This field is only used with l4 load balancing. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Oauth2ClientSecretSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Iap(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + oauth2ClientSecretSecretRef: Optional[Oauth2ClientSecretSecretRef] = None + """ + OAuth2 Client Secret for IAP + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Whether to enable logging for the load balancer traffic served by this backend service. + """ + optionalFields: Optional[List[str]] = None + """ + Specifies the fields to include in logging. This field can only be specified if logging is enabled for this backend service. + """ + optionalMode: Optional[str] = None + """ + Specifies the optional logging mode for the load balancer traffic. + Supported values: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + Possible values are: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + """ + sampleRate: Optional[float] = None + """ + This field can only be specified if logging is enabled for this backend service. The value of + the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer + where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. + The default value is 1.0. + """ + + +class BaseEjectionTime(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class Interval(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class OutlierDetection(BaseModel): + baseEjectionTime: Optional[BaseEjectionTime] = None + """ + The base time that a host is ejected for. The real time is equal to the base + time multiplied by the number of times the host has been ejected. Defaults to + 30000ms or 30s. + Structure is documented below. + """ + consecutiveErrors: Optional[float] = None + """ + Number of errors before a host is ejected from the connection pool. When the + backend host is accessed over HTTP, a 5xx return code qualifies as an error. + Defaults to 5. + """ + consecutiveGatewayFailure: Optional[float] = None + """ + The number of consecutive gateway failures (502, 503, 504 status or connection + errors that are mapped to one of those status codes) before a consecutive + gateway failure ejection occurs. Defaults to 5. + """ + enforcingConsecutiveErrors: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive 5xx. This setting can be used to disable + ejection or to ramp it up slowly. Defaults to 100. + """ + enforcingConsecutiveGatewayFailure: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive gateway failures. This setting can be + used to disable ejection or to ramp it up slowly. Defaults to 0. + """ + enforcingSuccessRate: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through success rate statistics. This setting can be used to + disable ejection or to ramp it up slowly. Defaults to 100. + """ + interval: Optional[Interval] = None + """ + Time interval between ejection sweep analysis. This can result in both new + ejections as well as hosts being returned to service. Defaults to 10 seconds. + Structure is documented below. + """ + maxEjectionPercent: Optional[float] = None + """ + Maximum percentage of hosts in the load balancing pool for the backend service + that can be ejected. Defaults to 10%. + """ + successRateMinimumHosts: Optional[float] = None + """ + The number of hosts in a cluster that must have enough request volume to detect + success rate outliers. If the number of hosts is less than this setting, outlier + detection via success rate statistics is not performed for any host in the + cluster. Defaults to 5. + """ + successRateRequestVolume: Optional[float] = None + """ + The minimum number of total requests that must be collected in one interval (as + defined by the interval duration above) to include this host in success rate + based outlier detection. If the volume is lower than this setting, outlier + detection via success rate statistics is not performed for that host. Defaults + to 100. + """ + successRateStdevFactor: Optional[float] = None + """ + This factor is used to determine the ejection threshold for success rate outlier + ejection. The ejection threshold is the difference between the mean success + rate, and the product of this factor and the standard deviation of the mean + success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided + by a thousand to get a double. That is, if the desired factor is 1.9, the + runtime value should be 1900. Defaults to 1900. + """ + + +class StrongSessionAffinityCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ForProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + customMetrics: Optional[List[CustomMetricModel]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[FailoverPolicy] = None + """ + Policy for failovers. + Structure is documented below. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to RegionHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of RegionHealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + region: str + """ + The Region in which the created backend service should reside. + If it is not provided, the provider region is used. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class CustomMetricModel1(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class CustomMetricModel2(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class InitProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + customMetrics: Optional[List[CustomMetricModel2]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[FailoverPolicy] = None + """ + Policy for failovers. + Structure is documented below. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to RegionHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of RegionHealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CustomMetricModel3(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class BackendItemModel(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + ~>NOTE: This field cannot be set for + INTERNAL region backend services (default loadBalancingScheme), + but is required for non-INTERNAL backend service. The total + capacity_scaler for all backends must be non-zero. + A setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetricModel3]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + failover: Optional[bool] = None + """ + This field designates whether this is a failover backend. More + than one failover backend can be configured for a given RegionBackendService. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + When the load_balancing_scheme is INTERNAL, only instance groups + are supported. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + Cannot be set for INTERNAL backend services. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. Cannot be set + for INTERNAL backend services. + This is used to calculate the capacity of the group. Can be + used in either CONNECTION or UTILIZATION balancing modes. For + CONNECTION mode, either maxConnections or + maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. Cannot be set for INTERNAL backend + services. + This is used to calculate the capacity of the group. + Can be used in either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. Cannot be set + for INTERNAL backend services. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. Either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. Cannot be set + for INTERNAL backend services. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. Cannot be set + for INTERNAL backend services. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + Cannot be set for INTERNAL backend services. + """ + + +class CustomMetricModel4(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class IapModel(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + + +class AtProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItemModel]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customMetrics: Optional[List[CustomMetricModel4]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[FailoverPolicy] = None + """ + Policy for failovers. + Structure is documented below. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + generatedId: Optional[float] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + iap: Optional[IapModel] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/backendServices/{{name}} + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + region: Optional[str] = None + """ + The Region in which the created backend service should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionBackendService(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionBackendService']] = 'RegionBackendService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionBackendServiceSpec defines the desired state of RegionBackendService + """ + status: Optional[Status] = None + """ + RegionBackendServiceStatus defines the observed state of RegionBackendService. + """ + + +class RegionBackendServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionBackendService] + """ + List of regionbackendservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondisk/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regiondisk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta1.py new file mode 100644 index 000000000..d6991617e --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta1.py @@ -0,0 +1,798 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regiondisk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AsyncPrimaryDiskItem(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a RegionDisk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a RegionDisk in compute to populate disk. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKeyItem(BaseModel): + kmsKeyName: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE. + """ + + +class SnapshotRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SnapshotSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceSnapshotEncryptionKeyItem(BaseModel): + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class ForProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[List[AsyncPrimaryDiskItem]] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItem]] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + region: str + """ + A reference to the region where the disk resides. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + snapshotRef: Optional[SnapshotRef] = None + """ + Reference to a Snapshot in compute to populate snapshot. + """ + snapshotSelector: Optional[SnapshotSelector] = None + """ + Selector for a Snapshot in compute to populate snapshot. + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class InitProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[List[AsyncPrimaryDiskItem]] = None + """ + A nested object resource + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItem]] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + snapshotRef: Optional[SnapshotRef] = None + """ + Reference to a Snapshot in compute to populate snapshot. + """ + snapshotSelector: Optional[SnapshotSelector] = None + """ + Selector for a Snapshot in compute to populate snapshot. + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[List[SourceSnapshotEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsyncPrimaryDiskItemModel(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + + +class DiskEncryptionKeyItemModel(BaseModel): + kmsKeyName: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyItemModel(BaseModel): + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class AtProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[List[AsyncPrimaryDiskItemModel]] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[List[DiskEncryptionKeyItemModel]] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + diskId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/disks/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + lastAttachTimestamp: Optional[str] = None + """ + Last attach timestamp in RFC3339 text format. + """ + lastDetachTimestamp: Optional[str] = None + """ + Last detach timestamp in RFC3339 text format. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceDiskId: Optional[str] = None + """ + The ID value of the disk used to create this image. This value may + be used to determine whether the image was taken from the current + or a previous instance of a given disk name. + """ + sourceSnapshotEncryptionKey: Optional[ + List[SourceSnapshotEncryptionKeyItemModel] + ] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceSnapshotId: Optional[str] = None + """ + The unique ID of the snapshot used to create this disk. This value + identifies the exact snapshot that was used to create this persistent + disk. For example, if you created the persistent disk from a snapshot + that was later deleted and recreated under the same name, the source + snapshot ID would identify the exact version of the snapshot that was + used. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + users: Optional[List[str]] = None + """ + Links to the users of the disk (attached instances) in form: + project/zones/zone/instances/instance + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDisk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionDisk']] = 'RegionDisk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskSpec defines the desired state of RegionDisk + """ + status: Optional[Status] = None + """ + RegionDiskStatus defines the observed state of RegionDisk. + """ + + +class RegionDiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDisk] + """ + List of regiondisks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta2.py new file mode 100644 index 000000000..2449227e1 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiondisk/v1beta2.py @@ -0,0 +1,796 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regiondisk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AsyncPrimaryDisk(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a RegionDisk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a RegionDisk in compute to populate disk. + """ + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class DiskEncryptionKey(BaseModel): + kmsKeyName: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE. + """ + + +class SnapshotRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SnapshotSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class ForProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + region: str + """ + A reference to the region where the disk resides. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + snapshotRef: Optional[SnapshotRef] = None + """ + Reference to a Snapshot in compute to populate snapshot. + """ + snapshotSelector: Optional[SnapshotSelector] = None + """ + Selector for a Snapshot in compute to populate snapshot. + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class InitProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + snapshotRef: Optional[SnapshotRef] = None + """ + Reference to a Snapshot in compute to populate snapshot. + """ + snapshotSelector: Optional[SnapshotSelector] = None + """ + Selector for a Snapshot in compute to populate snapshot. + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsyncPrimaryDiskModel(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + + +class DiskEncryptionKeyModel(BaseModel): + kmsKeyName: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class AtProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDiskModel] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKeyModel] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + diskId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/disks/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + lastAttachTimestamp: Optional[str] = None + """ + Last attach timestamp in RFC3339 text format. + """ + lastDetachTimestamp: Optional[str] = None + """ + Last detach timestamp in RFC3339 text format. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceDiskId: Optional[str] = None + """ + The ID value of the disk used to create this image. This value may + be used to determine whether the image was taken from the current + or a previous instance of a given disk name. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceSnapshotId: Optional[str] = None + """ + The unique ID of the snapshot used to create this disk. This value + identifies the exact snapshot that was used to create this persistent + disk. For example, if you created the persistent disk from a snapshot + that was later deleted and recreated under the same name, the source + snapshot ID would identify the exact version of the snapshot that was + used. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + users: Optional[List[str]] = None + """ + Links to the users of the disk (attached instances) in form: + project/zones/zone/instances/instance + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDisk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionDisk']] = 'RegionDisk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskSpec defines the desired state of RegionDisk + """ + status: Optional[Status] = None + """ + RegionDiskStatus defines the observed state of RegionDisk. + """ + + +class RegionDiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDisk] + """ + List of regiondisks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta1.py new file mode 100644 index 000000000..ca5be9e05 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta1.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regiondiskiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a RegionDisk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a RegionDisk in compute to populate name. + """ + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a RegionDisk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a RegionDisk in compute to populate name. + """ + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDiskIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionDiskIAMMember']] = 'RegionDiskIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskIAMMemberSpec defines the desired state of RegionDiskIAMMember + """ + status: Optional[Status] = None + """ + RegionDiskIAMMemberStatus defines the observed state of RegionDiskIAMMember. + """ + + +class RegionDiskIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDiskIAMMember] + """ + List of regiondiskiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta2.py new file mode 100644 index 000000000..9c5f0f6c9 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiondiskiammember/v1beta2.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regiondiskiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a RegionDisk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a RegionDisk in compute to populate name. + """ + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a RegionDisk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a RegionDisk in compute to populate name. + """ + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDiskIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionDiskIAMMember']] = 'RegionDiskIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskIAMMemberSpec defines the desired state of RegionDiskIAMMember + """ + status: Optional[Status] = None + """ + RegionDiskIAMMemberStatus defines the observed state of RegionDiskIAMMember. + """ + + +class RegionDiskIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDiskIAMMember] + """ + List of regiondiskiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondiskresourcepolicyattachment/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regiondiskresourcepolicyattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py new file mode 100644 index 000000000..5978909f6 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py @@ -0,0 +1,352 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regiondiskresourcepolicyattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the regional disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a RegionDisk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a RegionDisk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + + +class InitProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the regional disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a RegionDisk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a RegionDisk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the regional disk in which the resource policies are attached to. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{disk}}/{{name}} + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDiskResourcePolicyAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionDiskResourcePolicyAttachment']] = ( + 'RegionDiskResourcePolicyAttachment' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskResourcePolicyAttachmentSpec defines the desired state of RegionDiskResourcePolicyAttachment + """ + status: Optional[Status] = None + """ + RegionDiskResourcePolicyAttachmentStatus defines the observed state of RegionDiskResourcePolicyAttachment. + """ + + +class RegionDiskResourcePolicyAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDiskResourcePolicyAttachment] + """ + List of regiondiskresourcepolicyattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta1.py new file mode 100644 index 000000000..def0b7acf --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta1.py @@ -0,0 +1,668 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionhealthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class GrpcHealthCheckItem(BaseModel): + grpcServiceName: Optional[str] = None + """ + The gRPC service name for the health check. + The value of grpcServiceName has the following meanings by convention: + """ + port: Optional[float] = None + """ + The port number for the health check request. + Must be specified if portName and portSpecification are not set + or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + + +class Http2HealthCheckItem(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP2 health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP2 health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP2 health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpHealthCheckItem(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpsHealthCheckItem(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class LogConfigItem(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. This is false by default, + which means no health check logging will be done. + """ + + +class SslHealthCheckItem(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the SSL health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the SSL connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class TcpHealthCheckItem(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the TCP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the TCP connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[List[GrpcHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[List[Http2HealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpHealthCheck: Optional[List[HttpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpsHealthCheck: Optional[List[HttpsHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created health check should reside. + If it is not provided, the provider region is used. + """ + sslHealthCheck: Optional[List[SslHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + tcpHealthCheck: Optional[List[TcpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[List[GrpcHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[List[Http2HealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpHealthCheck: Optional[List[HttpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpsHealthCheck: Optional[List[HttpsHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sslHealthCheck: Optional[List[SslHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + tcpHealthCheck: Optional[List[TcpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[List[GrpcHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + healthCheckId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[List[Http2HealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpHealthCheck: Optional[List[HttpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + httpsHealthCheck: Optional[List[HttpsHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/healthChecks/{{name}} + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created health check should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sslHealthCheck: Optional[List[SslHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + tcpHealthCheck: Optional[List[TcpHealthCheckItem]] = None + """ + A nested object resource + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + type: Optional[str] = None + """ + The type of the health check. One of HTTP, HTTP2, HTTPS, TCP, or SSL. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionHealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionHealthCheck']] = 'RegionHealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionHealthCheckSpec defines the desired state of RegionHealthCheck + """ + status: Optional[Status] = None + """ + RegionHealthCheckStatus defines the observed state of RegionHealthCheck. + """ + + +class RegionHealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionHealthCheck] + """ + List of regionhealthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta2.py new file mode 100644 index 000000000..a600ad744 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionhealthcheck/v1beta2.py @@ -0,0 +1,668 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regionhealthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class GrpcHealthCheck(BaseModel): + grpcServiceName: Optional[str] = None + """ + The gRPC service name for the health check. + The value of grpcServiceName has the following meanings by convention: + """ + port: Optional[float] = None + """ + The port number for the health check request. + Must be specified if portName and portSpecification are not set + or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + + +class Http2HealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP2 health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP2 health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP2 health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpsHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. This is false by default, + which means no health check logging will be done. + """ + + +class SslHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the SSL health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the SSL connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class TcpHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the TCP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the TCP connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created health check should reside. + If it is not provided, the provider region is used. + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthCheckId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/healthChecks/{{name}} + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created health check should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + type: Optional[str] = None + """ + The type of the health check. One of HTTP, HTTP2, HTTPS, TCP, or SSL. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionHealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionHealthCheck']] = 'RegionHealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionHealthCheckSpec defines the desired state of RegionHealthCheck + """ + status: Optional[Status] = None + """ + RegionHealthCheckStatus defines the observed state of RegionHealthCheck. + """ + + +class RegionHealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionHealthCheck] + """ + List of regionhealthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta1.py new file mode 100644 index 000000000..77e77dbdb --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta1.py @@ -0,0 +1,977 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regioninstancegroupmanager.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AllInstancesConfigItem(BaseModel): + labels: Optional[Dict[str, str]] = None + """ + , The label key-value pairs that you want to patch onto the instance. + """ + metadata: Optional[Dict[str, str]] = None + """ + , The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthCheckRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthCheckSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AutoHealingPolicy(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + healthCheckRef: Optional[HealthCheckRef] = None + """ + Reference to a HealthCheck in compute to populate healthCheck. + """ + healthCheckSelector: Optional[HealthCheckSelector] = None + """ + Selector for a HealthCheck in compute to populate healthCheck. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class InstanceSelection(BaseModel): + machineTypes: Optional[List[str]] = None + """ + , A list of full machine-type names, e.g. "n1-standard-16". + """ + name: Optional[str] = None + """ + , Name of the instance selection, e.g. instance_selection_with_n1_machines_types. Instance selection names must be unique within the flexibility policy. + """ + rank: Optional[float] = None + """ + , Preference of this instance selection. Lower number means higher preference. Managed instance group will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference. + """ + + +class InstanceFlexibilityPolicyItem(BaseModel): + instanceSelections: Optional[List[InstanceSelection]] = None + """ + , Named instance selections configuring properties that the group will use when creating new VMs. One can specify multiple instance selection to allow managed instance group to create VMs from multiple types of machines, based on preference and availability. Structure is documented below. + """ + + +class InstanceLifecyclePolicyItem(BaseModel): + defaultActionOnFailure: Optional[str] = None + """ + , Default behavior for all instance or health check failures. Valid options are: REPAIR, DO_NOTHING. If DO_NOTHING then instances will not be repaired. If REPAIR (default), then failed instances will be repaired. + """ + forceUpdateOnRepair: Optional[str] = None + """ + ), Specifies whether to apply the group's latest configuration when repairing a VM. Valid options are: YES, NO. If YES and you updated the group's instance template or per-instance configurations after the VM was created, then these changes are applied when VM is repaired. If NO (default), then updates are applied in accordance with the group's update policy type. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name of the port. + """ + port: Optional[float] = None + """ + The port number. + """ + + +class StatefulDiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the disk when the VM is deleted, but do not delete the disk. ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently deleted from the instance group. The default is NEVER. + """ + deviceName: Optional[str] = None + """ + , The device name of the disk to be attached. + """ + + +class StatefulExternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the external ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the external ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the external Ip. Possible value: nic0. + """ + + +class StatefulInternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the internal ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the internal ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the internal Ip. Possible value: nic0. + """ + + +class TargetPoolsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetPoolsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UpdatePolicyItem(BaseModel): + instanceRedistributionType: Optional[str] = None + """ + - The instance redistribution policy for regional managed instance groups. Valid values are: "PROACTIVE", "NONE". If PROACTIVE (default), the group attempts to maintain an even distribution of VM instances across zones in the region. If NONE, proactive redistribution is disabled. + """ + maxSurgeFixed: Optional[float] = None + """ + , The maximum number of instances that can be created above the specified targetSize during the update process. Conflicts with max_surge_percent. It has to be either 0 or at least equal to the number of zones. If fixed values are used, at least one of max_unavailable_fixed or max_surge_fixed must be greater than 0. + """ + maxSurgePercent: Optional[float] = None + """ + , The maximum number of instances(calculated as percentage) that can be created above the specified targetSize during the update process. Conflicts with max_surge_fixed. Percent value is only allowed for regional managed instance groups with size at least 10. + """ + maxUnavailableFixed: Optional[float] = None + """ + , The maximum number of instances that can be unavailable during the update process. Conflicts with max_unavailable_percent. It has to be either 0 or at least equal to the number of zones. If fixed values are used, at least one of max_unavailable_fixed or max_surge_fixed must be greater than 0. + """ + maxUnavailablePercent: Optional[float] = None + """ + , The maximum number of instances(calculated as percentage) that can be unavailable during the update process. Conflicts with max_unavailable_fixed. Percent value is only allowed for regional managed instance groups with size at least 10. + """ + minimalAction: Optional[str] = None + """ + - Minimal action to be taken on an instance. You can specify either REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + """ + replacementMethod: Optional[str] = None + """ + , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved. You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0. + """ + type: Optional[str] = None + """ + - The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + """ + + +class InstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetSizeItem(BaseModel): + fixed: Optional[float] = None + """ + , The number of instances which are managed for this version. Conflicts with percent. + """ + percent: Optional[float] = None + """ + , The number of instances (calculated as percentage) which are managed for this version. Conflicts with fixed. + Note that when using percent, rounding will be in favor of explicitly set target_size values; a managed instance group with 2 instances and 2 versions, + one of which has a target_size.percent of 60 will create 2 instances of that version. + """ + + +class VersionItem(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. + """ + instanceTemplateRef: Optional[InstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate instanceTemplate. + """ + instanceTemplateSelector: Optional[InstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate instanceTemplate. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[List[TargetSizeItem]] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class ForProvider(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[List[AutoHealingPolicy]] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + instanceFlexibilityPolicy: Optional[List[InstanceFlexibilityPolicyItem]] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceLifecyclePolicy: Optional[List[InstanceLifecyclePolicyItem]] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[List[UpdatePolicyItem]] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class StandbyPolicyItem(BaseModel): + initialDelaySec: Optional[float] = None + """ + - Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + """ + mode: Optional[str] = None + """ + - Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. Valid options are: MANUAL, SCALE_OUT_POOL. If MANUAL(default), you have full control over which VMs are stopped and suspended in the MIG. If SCALE_OUT_POOL, the MIG uses the VMs from the standby pools to accelerate the scale out by resuming or starting them and then automatically replenishes the standby pool with new VMs to maintain the target sizes. + """ + + +class InitProvider(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[List[AutoHealingPolicy]] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + instanceFlexibilityPolicy: Optional[List[InstanceFlexibilityPolicyItem]] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceLifecyclePolicy: Optional[List[InstanceLifecyclePolicyItem]] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + standbyPolicy: Optional[List[StandbyPolicyItem]] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[List[UpdatePolicyItem]] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AutoHealingPolicyModel(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class AllInstancesConfigItemModel(BaseModel): + currentRevision: Optional[str] = None + """ + Current all-instances configuration revision. This value is in RFC3339 text format. + """ + effective: Optional[bool] = None + + +class PerInstanceConfig(BaseModel): + allEffective: Optional[bool] = None + """ + A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + """ + + +class StatefulItem(BaseModel): + hasStatefulConfig: Optional[bool] = None + """ + A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + """ + perInstanceConfigs: Optional[List[PerInstanceConfig]] = None + """ + Status of per-instance configs on the instance. + """ + + +class VersionTargetItem(BaseModel): + isReached: Optional[bool] = None + + +class StatusItem(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItemModel]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + isStable: Optional[bool] = None + """ + A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + """ + stateful: Optional[List[StatefulItem]] = None + """ + Stateful status of the given Instance Group Manager. + """ + versionTarget: Optional[List[VersionTargetItem]] = None + """ + A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + """ + + +class VersionItemModel(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[List[TargetSizeItem]] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class AtProvider(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[List[AutoHealingPolicyModel]] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + creationTimestamp: Optional[str] = None + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + fingerprint: Optional[str] = None + """ + The fingerprint of the instance group manager. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{name}} + """ + instanceFlexibilityPolicy: Optional[List[InstanceFlexibilityPolicyItem]] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceGroup: Optional[str] = None + """ + The full URL of the instance group created by the manager. + """ + instanceGroupManagerId: Optional[float] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{name}} + """ + instanceLifecyclePolicy: Optional[List[InstanceLifecyclePolicyItem]] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URL of the created resource. + """ + standbyPolicy: Optional[List[StandbyPolicyItem]] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + status: Optional[List[StatusItem]] = None + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[List[UpdatePolicyItem]] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItemModel]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionInstanceGroupManager(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionInstanceGroupManager']] = 'RegionInstanceGroupManager' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionInstanceGroupManagerSpec defines the desired state of RegionInstanceGroupManager + """ + status: Optional[Status] = None + """ + RegionInstanceGroupManagerStatus defines the observed state of RegionInstanceGroupManager. + """ + + +class RegionInstanceGroupManagerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionInstanceGroupManager] + """ + List of regioninstancegroupmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta2.py new file mode 100644 index 000000000..28fdfd2d9 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regioninstancegroupmanager/v1beta2.py @@ -0,0 +1,985 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regioninstancegroupmanager.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AllInstancesConfig(BaseModel): + labels: Optional[Dict[str, str]] = None + """ + , The label key-value pairs that you want to patch onto the instance. + """ + metadata: Optional[Dict[str, str]] = None + """ + , The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthCheckRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthCheckSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AutoHealingPolicies(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + healthCheckRef: Optional[HealthCheckRef] = None + """ + Reference to a HealthCheck in compute to populate healthCheck. + """ + healthCheckSelector: Optional[HealthCheckSelector] = None + """ + Selector for a HealthCheck in compute to populate healthCheck. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class InstanceSelection(BaseModel): + machineTypes: Optional[List[str]] = None + """ + , A list of full machine-type names, e.g. "n1-standard-16". + """ + name: Optional[str] = None + """ + , Name of the instance selection, e.g. instance_selection_with_n1_machines_types. Instance selection names must be unique within the flexibility policy. + """ + rank: Optional[float] = None + """ + , Preference of this instance selection. Lower number means higher preference. Managed instance group will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference. + """ + + +class InstanceFlexibilityPolicy(BaseModel): + instanceSelections: Optional[List[InstanceSelection]] = None + """ + , Named instance selections configuring properties that the group will use when creating new VMs. One can specify multiple instance selection to allow managed instance group to create VMs from multiple types of machines, based on preference and availability. Structure is documented below. + """ + + +class InstanceLifecyclePolicy(BaseModel): + defaultActionOnFailure: Optional[str] = None + """ + , Specifies the action that a MIG performs on a failed VM. If the value of the on_failed_health_check field is DEFAULT_ACTION, then the same action also applies to the VMs on which your application fails a health check. Valid options are: DO_NOTHING, REPAIR. If DO_NOTHING, then MIG does not repair a failed VM. If REPAIR (default), then MIG automatically repairs a failed VM by recreating it. For more information, see about repairing VMs in a MIG. + """ + forceUpdateOnRepair: Optional[str] = None + """ + , Specifies whether to apply the group's latest configuration when repairing a VM. Valid options are: YES, NO. If YES and you updated the group's instance template or per-instance configurations after the VM was created, then these changes are applied when VM is repaired. If NO (default), then updates are applied in accordance with the group's update policy type. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name of the port. + """ + port: Optional[float] = None + """ + The port number. + """ + + +class StandbyPolicy(BaseModel): + initialDelaySec: Optional[float] = None + """ + - Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + """ + mode: Optional[str] = None + """ + - Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. Valid options are: MANUAL, SCALE_OUT_POOL. If MANUAL(default), you have full control over which VMs are stopped and suspended in the MIG. If SCALE_OUT_POOL, the MIG uses the VMs from the standby pools to accelerate the scale out by resuming or starting them and then automatically replenishes the standby pool with new VMs to maintain the target sizes. + """ + + +class StatefulDiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the disk when the VM is deleted, but do not delete the disk. ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently deleted from the instance group. The default is NEVER. + """ + deviceName: Optional[str] = None + """ + , The device name of the disk to be attached. + """ + + +class StatefulExternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the external ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the external ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the external Ip. Possible value: nic0. + """ + + +class StatefulInternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the internal ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the internal ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the internal Ip. Possible value: nic0. + """ + + +class TargetPoolsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetPoolsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UpdatePolicy(BaseModel): + instanceRedistributionType: Optional[str] = None + """ + - The instance redistribution policy for regional managed instance groups. Valid values are: "PROACTIVE", "NONE". If PROACTIVE (default), the group attempts to maintain an even distribution of VM instances across zones in the region. If NONE, proactive redistribution is disabled. + """ + maxSurgeFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. Conflicts with max_surge_percent. Both cannot be 0. + """ + maxSurgePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. Conflicts with max_surge_fixed. + """ + maxUnavailableFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. + """ + maxUnavailablePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.. + """ + minimalAction: Optional[str] = None + """ + - Minimal action to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + """ + replacementMethod: Optional[str] = None + """ + , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved. You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0. + """ + type: Optional[str] = None + """ + - The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + """ + + +class InstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetSize(BaseModel): + fixed: Optional[float] = None + """ + , The number of instances which are managed for this version. Conflicts with percent. + """ + percent: Optional[float] = None + """ + , The number of instances (calculated as percentage) which are managed for this version. Conflicts with fixed. + Note that when using percent, rounding will be in favor of explicitly set target_size values; a managed instance group with 2 instances and 2 versions, + one of which has a target_size.percent of 60 will create 2 instances of that version. + """ + + +class VersionItem(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. + """ + instanceTemplateRef: Optional[InstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate instanceTemplate. + """ + instanceTemplateSelector: Optional[InstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate instanceTemplate. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class ForProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + instanceFlexibilityPolicy: Optional[InstanceFlexibilityPolicy] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class InitProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + instanceFlexibilityPolicy: Optional[InstanceFlexibilityPolicy] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AutoHealingPoliciesModel(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class AllInstancesConfigItem(BaseModel): + currentRevision: Optional[str] = None + """ + Current all-instances configuration revision. This value is in RFC3339 text format. + """ + effective: Optional[bool] = None + """ + A bit indicating whether this configuration has been applied to all managed instances in the group. + """ + + +class PerInstanceConfig(BaseModel): + allEffective: Optional[bool] = None + """ + A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + """ + + +class StatefulItem(BaseModel): + hasStatefulConfig: Optional[bool] = None + """ + A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + """ + perInstanceConfigs: Optional[List[PerInstanceConfig]] = None + """ + Status of per-instance configs on the instances. + """ + + +class VersionTargetItem(BaseModel): + isReached: Optional[bool] = None + + +class StatusItem(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Status of all-instances configuration on the group. + """ + isStable: Optional[bool] = None + """ + A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + """ + stateful: Optional[List[StatefulItem]] = None + """ + Stateful status of the given Instance Group Manager. + """ + versionTarget: Optional[List[VersionTargetItem]] = None + """ + A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + """ + + +class VersionItemModel(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class AtProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPoliciesModel] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + fingerprint: Optional[str] = None + """ + The fingerprint of the instance group manager. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{name}} + """ + instanceFlexibilityPolicy: Optional[InstanceFlexibilityPolicy] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceGroup: Optional[str] = None + """ + The full URL of the instance group created by the manager. + """ + instanceGroupManagerId: Optional[float] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{name}} + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URL of the created resource. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + status: Optional[List[StatusItem]] = None + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItemModel]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionInstanceGroupManager(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionInstanceGroupManager']] = 'RegionInstanceGroupManager' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionInstanceGroupManagerSpec defines the desired state of RegionInstanceGroupManager + """ + status: Optional[Status] = None + """ + RegionInstanceGroupManagerStatus defines the observed state of RegionInstanceGroupManager. + """ + + +class RegionInstanceGroupManagerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionInstanceGroupManager] + """ + List of regioninstancegroupmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpoint/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpoint/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpoint/v1beta1.py new file mode 100644 index 000000000..a695fd4f3 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpoint/v1beta1.py @@ -0,0 +1,342 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionnetworkendpoint.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class RegionNetworkEndpointGroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionNetworkEndpointGroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing network endpoint group is located. + """ + regionNetworkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + regionNetworkEndpointGroupRef: Optional[RegionNetworkEndpointGroupRef] = None + """ + Reference to a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + regionNetworkEndpointGroupSelector: Optional[RegionNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + + +class InitProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing network endpoint group is located. + """ + regionNetworkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + regionNetworkEndpointGroupRef: Optional[RegionNetworkEndpointGroupRef] = None + """ + Reference to a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + regionNetworkEndpointGroupSelector: Optional[RegionNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT. + """ + networkEndpointId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing network endpoint group is located. + """ + regionNetworkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkEndpoint(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkEndpoint']] = 'RegionNetworkEndpoint' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkEndpointSpec defines the desired state of RegionNetworkEndpoint + """ + status: Optional[Status] = None + """ + RegionNetworkEndpointStatus defines the observed state of RegionNetworkEndpoint. + """ + + +class RegionNetworkEndpointList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkEndpoint] + """ + List of regionnetworkendpoints. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta1.py new file mode 100644 index 000000000..fd0066726 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta1.py @@ -0,0 +1,712 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionnetworkendpointgroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AppEngineItem(BaseModel): + service: Optional[str] = None + """ + Optional serving service. + The service name must be 1-63 characters long, and comply with RFC1035. + Example value: "default", "my-service". + """ + urlMask: Optional[str] = None + """ + A template to parse service and version fields from a request URL. + URL mask allows for routing to multiple App Engine services without + having to create multiple Network Endpoint Groups and backend services. + For example, the request URLs "foo1-dot-appname.appspot.com/v1" and + "foo1-dot-appname.appspot.com/v2" can be backed by the same Serverless NEG with + URL mask "-dot-appname.appspot.com/". The URL mask will parse + them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + """ + version: Optional[str] = None + """ + Optional serving version. + The version must be 1-63 characters long, and comply with RFC1035. + Example value: "v1", "v2". + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FunctionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CloudFunctionItem(BaseModel): + function: Optional[str] = None + """ + A user-defined name of the Cloud Function. + The function name is case-sensitive and must be 1-63 characters long. + Example value: "func1". + """ + functionRef: Optional[FunctionRef] = None + """ + Reference to a Function in cloudfunctions to populate function. + """ + functionSelector: Optional[FunctionSelector] = None + """ + Selector for a Function in cloudfunctions to populate function. + """ + urlMask: Optional[str] = None + """ + A template to parse function field from a request URL. URL mask allows + for routing to multiple Cloud Functions without having to create + multiple Network Endpoint Groups and backend services. + For example, request URLs "mydomain.com/function1" and "mydomain.com/function2" + can be backed by the same Serverless NEG with URL mask "/". The URL mask + will parse them to { function = "function1" } and { function = "function2" } respectively. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CloudRunItem(BaseModel): + service: Optional[str] = None + """ + Cloud Run service is the main resource of Cloud Run. + The service must be 1-63 characters long, and comply with RFC1035. + Example value: "run-service". + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a Service in cloudrun to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a Service in cloudrun to populate service. + """ + tag: Optional[str] = None + """ + Cloud Run tag represents the "named-revision" to provide + additional fine-grained traffic routing information. + The tag must be 1-63 characters long, and comply with RFC1035. + Example value: "revision-0010". + """ + urlMask: Optional[str] = None + """ + A template to parse service and tag fields from a request URL. + URL mask allows for routing to multiple Run services without having + to create multiple network endpoint groups and backend services. + For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" + an be backed by the same Serverless Network Endpoint Group (NEG) with + URL mask ".domain.com/". The URL mask will parse them to { service="bar1", tag="foo1" } + and { service="bar2", tag="foo2" } respectively. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PscDatum(BaseModel): + producerPort: Optional[str] = None + """ + The PSC producer port to use when consumer PSC NEG connects to a producer. If + this flag isn't specified for a PSC NEG with endpoint type + private-service-connect, then PSC NEG will be connected to a first port in the + available PSC producer port range. + """ + + +class PscTargetServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PscTargetServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + appEngine: Optional[List[AppEngineItem]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[List[CloudFunctionItem]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[List[CloudRunItem]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[List[PscDatum]] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + pscTargetServiceRef: Optional[PscTargetServiceRef] = None + """ + Reference to a ServiceAttachment in compute to populate pscTargetService. + """ + pscTargetServiceSelector: Optional[PscTargetServiceSelector] = None + """ + Selector for a ServiceAttachment in compute to populate pscTargetService. + """ + region: str + """ + A reference to the region where the regional NEGs reside. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + appEngine: Optional[List[AppEngineItem]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[List[CloudFunctionItem]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[List[CloudRunItem]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[List[PscDatum]] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + pscTargetServiceRef: Optional[PscTargetServiceRef] = None + """ + Reference to a ServiceAttachment in compute to populate pscTargetService. + """ + pscTargetServiceSelector: Optional[PscTargetServiceSelector] = None + """ + Selector for a ServiceAttachment in compute to populate pscTargetService. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CloudFunctionItemModel(BaseModel): + function: Optional[str] = None + """ + A user-defined name of the Cloud Function. + The function name is case-sensitive and must be 1-63 characters long. + Example value: "func1". + """ + urlMask: Optional[str] = None + """ + A template to parse function field from a request URL. URL mask allows + for routing to multiple Cloud Functions without having to create + multiple Network Endpoint Groups and backend services. + For example, request URLs "mydomain.com/function1" and "mydomain.com/function2" + can be backed by the same Serverless NEG with URL mask "/". The URL mask + will parse them to { function = "function1" } and { function = "function2" } respectively. + """ + + +class CloudRunItemModel(BaseModel): + service: Optional[str] = None + """ + Cloud Run service is the main resource of Cloud Run. + The service must be 1-63 characters long, and comply with RFC1035. + Example value: "run-service". + """ + tag: Optional[str] = None + """ + Cloud Run tag represents the "named-revision" to provide + additional fine-grained traffic routing information. + The tag must be 1-63 characters long, and comply with RFC1035. + Example value: "revision-0010". + """ + urlMask: Optional[str] = None + """ + A template to parse service and tag fields from a request URL. + URL mask allows for routing to multiple Run services without having + to create multiple network endpoint groups and backend services. + For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" + an be backed by the same Serverless Network Endpoint Group (NEG) with + URL mask ".domain.com/". The URL mask will parse them to { service="bar1", tag="foo1" } + and { service="bar2", tag="foo2" } respectively. + """ + + +class AtProvider(BaseModel): + appEngine: Optional[List[AppEngineItem]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[List[CloudFunctionItemModel]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[List[CloudRunItemModel]] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{name}} + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[List[PscDatum]] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + region: Optional[str] = None + """ + A reference to the region where the regional NEGs reside. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkEndpointGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkEndpointGroup']] = 'RegionNetworkEndpointGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkEndpointGroupSpec defines the desired state of RegionNetworkEndpointGroup + """ + status: Optional[Status] = None + """ + RegionNetworkEndpointGroupStatus defines the observed state of RegionNetworkEndpointGroup. + """ + + +class RegionNetworkEndpointGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkEndpointGroup] + """ + List of regionnetworkendpointgroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta2.py new file mode 100644 index 000000000..9dfb7980d --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionnetworkendpointgroup/v1beta2.py @@ -0,0 +1,712 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regionnetworkendpointgroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AppEngine(BaseModel): + service: Optional[str] = None + """ + Optional serving service. + The service name must be 1-63 characters long, and comply with RFC1035. + Example value: "default", "my-service". + """ + urlMask: Optional[str] = None + """ + A template to parse service and version fields from a request URL. + URL mask allows for routing to multiple App Engine services without + having to create multiple Network Endpoint Groups and backend services. + For example, the request URLs "foo1-dot-appname.appspot.com/v1" and + "foo1-dot-appname.appspot.com/v2" can be backed by the same Serverless NEG with + URL mask "-dot-appname.appspot.com/". The URL mask will parse + them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + """ + version: Optional[str] = None + """ + Optional serving version. + The version must be 1-63 characters long, and comply with RFC1035. + Example value: "v1", "v2". + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FunctionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CloudFunction(BaseModel): + function: Optional[str] = None + """ + A user-defined name of the Cloud Function. + The function name is case-sensitive and must be 1-63 characters long. + Example value: "func1". + """ + functionRef: Optional[FunctionRef] = None + """ + Reference to a Function in cloudfunctions to populate function. + """ + functionSelector: Optional[FunctionSelector] = None + """ + Selector for a Function in cloudfunctions to populate function. + """ + urlMask: Optional[str] = None + """ + A template to parse function field from a request URL. URL mask allows + for routing to multiple Cloud Functions without having to create + multiple Network Endpoint Groups and backend services. + For example, request URLs "mydomain.com/function1" and "mydomain.com/function2" + can be backed by the same Serverless NEG with URL mask "/". The URL mask + will parse them to { function = "function1" } and { function = "function2" } respectively. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CloudRun(BaseModel): + service: Optional[str] = None + """ + Cloud Run service is the main resource of Cloud Run. + The service must be 1-63 characters long, and comply with RFC1035. + Example value: "run-service". + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a Service in cloudrun to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a Service in cloudrun to populate service. + """ + tag: Optional[str] = None + """ + Cloud Run tag represents the "named-revision" to provide + additional fine-grained traffic routing information. + The tag must be 1-63 characters long, and comply with RFC1035. + Example value: "revision-0010". + """ + urlMask: Optional[str] = None + """ + A template to parse service and tag fields from a request URL. + URL mask allows for routing to multiple Run services without having + to create multiple network endpoint groups and backend services. + For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" + an be backed by the same Serverless Network Endpoint Group (NEG) with + URL mask ".domain.com/". The URL mask will parse them to { service="bar1", tag="foo1" } + and { service="bar2", tag="foo2" } respectively. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PscData(BaseModel): + producerPort: Optional[str] = None + """ + The PSC producer port to use when consumer PSC NEG connects to a producer. If + this flag isn't specified for a PSC NEG with endpoint type + private-service-connect, then PSC NEG will be connected to a first port in the + available PSC producer port range. + """ + + +class PscTargetServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PscTargetServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + appEngine: Optional[AppEngine] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[CloudFunction] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[CloudRun] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, GCE_VM_IP_PORTMAP. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[PscData] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + pscTargetServiceRef: Optional[PscTargetServiceRef] = None + """ + Reference to a ServiceAttachment in compute to populate pscTargetService. + """ + pscTargetServiceSelector: Optional[PscTargetServiceSelector] = None + """ + Selector for a ServiceAttachment in compute to populate pscTargetService. + """ + region: str + """ + A reference to the region where the regional NEGs reside. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + appEngine: Optional[AppEngine] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[CloudFunction] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[CloudRun] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, GCE_VM_IP_PORTMAP. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[PscData] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + pscTargetServiceRef: Optional[PscTargetServiceRef] = None + """ + Reference to a ServiceAttachment in compute to populate pscTargetService. + """ + pscTargetServiceSelector: Optional[PscTargetServiceSelector] = None + """ + Selector for a ServiceAttachment in compute to populate pscTargetService. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CloudFunctionModel(BaseModel): + function: Optional[str] = None + """ + A user-defined name of the Cloud Function. + The function name is case-sensitive and must be 1-63 characters long. + Example value: "func1". + """ + urlMask: Optional[str] = None + """ + A template to parse function field from a request URL. URL mask allows + for routing to multiple Cloud Functions without having to create + multiple Network Endpoint Groups and backend services. + For example, request URLs "mydomain.com/function1" and "mydomain.com/function2" + can be backed by the same Serverless NEG with URL mask "/". The URL mask + will parse them to { function = "function1" } and { function = "function2" } respectively. + """ + + +class CloudRunModel(BaseModel): + service: Optional[str] = None + """ + Cloud Run service is the main resource of Cloud Run. + The service must be 1-63 characters long, and comply with RFC1035. + Example value: "run-service". + """ + tag: Optional[str] = None + """ + Cloud Run tag represents the "named-revision" to provide + additional fine-grained traffic routing information. + The tag must be 1-63 characters long, and comply with RFC1035. + Example value: "revision-0010". + """ + urlMask: Optional[str] = None + """ + A template to parse service and tag fields from a request URL. + URL mask allows for routing to multiple Run services without having + to create multiple network endpoint groups and backend services. + For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" + an be backed by the same Serverless Network Endpoint Group (NEG) with + URL mask ".domain.com/". The URL mask will parse them to { service="bar1", tag="foo1" } + and { service="bar2", tag="foo2" } respectively. + """ + + +class AtProvider(BaseModel): + appEngine: Optional[AppEngine] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[CloudFunctionModel] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[CloudRunModel] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{name}} + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, GCE_VM_IP_PORTMAP. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[PscData] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + region: Optional[str] = None + """ + A reference to the region where the regional NEGs reside. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkEndpointGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionNetworkEndpointGroup']] = 'RegionNetworkEndpointGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkEndpointGroupSpec defines the desired state of RegionNetworkEndpointGroup + """ + status: Optional[Status] = None + """ + RegionNetworkEndpointGroupStatus defines the observed state of RegionNetworkEndpointGroup. + """ + + +class RegionNetworkEndpointGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkEndpointGroup] + """ + List of regionnetworkendpointgroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py new file mode 100644 index 000000000..6ba7f7772 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py @@ -0,0 +1,271 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionnetworkfirewallpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region of this resource. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of the resource. This field is used internally during updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/firewallPolicies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region of this resource. + """ + regionNetworkFirewallPolicyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + ruleTupleCount: Optional[float] = None + """ + Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkFirewallPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkFirewallPolicy']] = ( + 'RegionNetworkFirewallPolicy' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkFirewallPolicySpec defines the desired state of RegionNetworkFirewallPolicy + """ + status: Optional[Status] = None + """ + RegionNetworkFirewallPolicyStatus defines the observed state of RegionNetworkFirewallPolicy. + """ + + +class RegionNetworkFirewallPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkFirewallPolicy] + """ + List of regionnetworkfirewallpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicyassociation/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicyassociation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py new file mode 100644 index 000000000..e88c020b4 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py @@ -0,0 +1,337 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionnetworkfirewallpolicyassociation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class AttachmentTargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class AttachmentTargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a RegionNetworkFirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a RegionNetworkFirewallPolicy in compute to populate firewallPolicy. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The location of this resource. + """ + + +class InitProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The location of this resource. + """ + shortName: Optional[str] = None + """ + The short name of the firewall policy of the association. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkFirewallPolicyAssociation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkFirewallPolicyAssociation']] = ( + 'RegionNetworkFirewallPolicyAssociation' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkFirewallPolicyAssociationSpec defines the desired state of RegionNetworkFirewallPolicyAssociation + """ + status: Optional[Status] = None + """ + RegionNetworkFirewallPolicyAssociationStatus defines the observed state of RegionNetworkFirewallPolicyAssociation. + """ + + +class RegionNetworkFirewallPolicyAssociationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkFirewallPolicyAssociation] + """ + List of regionnetworkfirewallpolicyassociations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta1.py new file mode 100644 index 000000000..95a16857d --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta1.py @@ -0,0 +1,585 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionperinstanceconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + + +class IpAddres(BaseModel): + address: Optional[str] = None + """ + The URL of the reservation for this IP address. + """ + + +class ExternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[List[IpAddres]] = None + """ + Ip address representation + Structure is documented below. + """ + + +class InternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[List[IpAddres]] = None + """ + Ip address representation + Structure is documented below. + """ + + +class PreservedStateItem(BaseModel): + disk: Optional[List[DiskItem]] = None + """ + Stateful disks for the instance. + Structure is documented below. + """ + externalIp: Optional[List[ExternalIpItem]] = None + """ + Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + internalIp: Optional[List[InternalIpItem]] = None + """ + Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + metadata: Optional[Dict[str, str]] = None + """ + Preserved metadata defined for this instance. This is a list of key->value pairs. + """ + + +class RegionInstanceGroupManagerRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionInstanceGroupManagerSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RegionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[List[PreservedStateItem]] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + regionInstanceGroupManagerRef: Optional[RegionInstanceGroupManagerRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionInstanceGroupManagerSelector: Optional[RegionInstanceGroupManagerSelector] = ( + None + ) + """ + Selector for a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate region. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class InitProvider(BaseModel): + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[List[PreservedStateItem]] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + regionInstanceGroupManagerRef: Optional[RegionInstanceGroupManagerRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionInstanceGroupManagerSelector: Optional[RegionInstanceGroupManagerSelector] = ( + None + ) + """ + Selector for a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate region. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DiskItemModel(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{region_instance_group_manager}}/{{name}} + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[List[PreservedStateItem]] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionPerInstanceConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionPerInstanceConfig']] = 'RegionPerInstanceConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionPerInstanceConfigSpec defines the desired state of RegionPerInstanceConfig + """ + status: Optional[Status] = None + """ + RegionPerInstanceConfigStatus defines the observed state of RegionPerInstanceConfig. + """ + + +class RegionPerInstanceConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionPerInstanceConfig] + """ + List of regionperinstanceconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta2.py new file mode 100644 index 000000000..9c5d39aef --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionperinstanceconfig/v1beta2.py @@ -0,0 +1,585 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regionperinstanceconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + + +class IpAddress(BaseModel): + address: Optional[str] = None + """ + The URL of the reservation for this IP address. + """ + + +class ExternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class InternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class PreservedState(BaseModel): + disk: Optional[List[DiskItem]] = None + """ + Stateful disks for the instance. + Structure is documented below. + """ + externalIp: Optional[List[ExternalIpItem]] = None + """ + Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + internalIp: Optional[List[InternalIpItem]] = None + """ + Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + metadata: Optional[Dict[str, str]] = None + """ + Preserved metadata defined for this instance. This is a list of key->value pairs. + """ + + +class RegionInstanceGroupManagerRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionInstanceGroupManagerSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RegionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + regionInstanceGroupManagerRef: Optional[RegionInstanceGroupManagerRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionInstanceGroupManagerSelector: Optional[RegionInstanceGroupManagerSelector] = ( + None + ) + """ + Selector for a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate region. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class InitProvider(BaseModel): + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + regionInstanceGroupManagerRef: Optional[RegionInstanceGroupManagerRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionInstanceGroupManagerSelector: Optional[RegionInstanceGroupManagerSelector] = ( + None + ) + """ + Selector for a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate region. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DiskItemModel(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{region_instance_group_manager}}/{{name}} + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionPerInstanceConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionPerInstanceConfig']] = 'RegionPerInstanceConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionPerInstanceConfigSpec defines the desired state of RegionPerInstanceConfig + """ + status: Optional[Status] = None + """ + RegionPerInstanceConfigStatus defines the observed state of RegionPerInstanceConfig. + """ + + +class RegionPerInstanceConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionPerInstanceConfig] + """ + List of regionperinstanceconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionsecuritypolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionsecuritypolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionsecuritypolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionsecuritypolicy/v1beta1.py new file mode 100644 index 000000000..0d27ad4cd --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionsecuritypolicy/v1beta1.py @@ -0,0 +1,763 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionsecuritypolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class DdosProtectionConfig(BaseModel): + ddosProtection: Optional[str] = None + """ + Google Cloud Armor offers the following options to help protect systems against DDoS attacks: + """ + + +class Config(BaseModel): + srcIpRanges: Optional[List[str]] = None + """ + Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + """ + + +class Expr(BaseModel): + expression: Optional[str] = None + """ + Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported. + """ + + +class Match(BaseModel): + config: Optional[Config] = None + """ + The configuration options available when specifying versionedExpr. + This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. + Structure is documented below. + """ + expr: Optional[Expr] = None + """ + User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. See Sample expressions for examples. + Structure is documented below. + """ + versionedExpr: Optional[str] = None + """ + Preconfigured versioned expression. If this field is specified, config must also be specified. + Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. + Possible values are: SRC_IPS_V1. + """ + + +class UserDefinedField(BaseModel): + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + values: Optional[List[str]] = None + """ + Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + """ + + +class NetworkMatch(BaseModel): + destIpRanges: Optional[List[str]] = None + """ + Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + """ + destPorts: Optional[List[str]] = None + """ + Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + """ + ipProtocols: Optional[List[str]] = None + """ + IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp". + """ + srcAsns: Optional[List[float]] = None + """ + BGP Autonomous System Number associated with the source IP address. + """ + srcIpRanges: Optional[List[str]] = None + """ + Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + """ + srcPorts: Optional[List[str]] = None + """ + Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + """ + srcRegionCodes: Optional[List[str]] = None + """ + Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address. + """ + userDefinedFields: Optional[List[UserDefinedField]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class RequestCookieItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class RequestHeaderItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class RequestQueryParamItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class RequestUriItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class ExclusionItem(BaseModel): + requestCookie: Optional[List[RequestCookieItem]] = None + """ + Request cookie whose value will be excluded from inspection during preconfigured WAF evaluation. + Structure is documented below. + """ + requestHeader: Optional[List[RequestHeaderItem]] = None + """ + Request header whose value will be excluded from inspection during preconfigured WAF evaluation. + Structure is documented below. + """ + requestQueryParam: Optional[List[RequestQueryParamItem]] = None + """ + Request query parameter whose value will be excluded from inspection during preconfigured WAF evaluation. + Note that the parameter can be in the query string or in the POST body. + Structure is documented below. + """ + requestUri: Optional[List[RequestUriItem]] = None + """ + Request URI from the request line to be excluded from inspection during preconfigured WAF evaluation. + When specifying this field, the query or fragment part should be excluded. + Structure is documented below. + """ + targetRuleIds: Optional[List[str]] = None + """ + A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. + If omitted, it refers to all the rule IDs under the WAF rule set. + """ + targetRuleSet: Optional[str] = None + """ + Target WAF rule set to apply the preconfigured WAF exclusion. + """ + + +class PreconfiguredWafConfig(BaseModel): + exclusion: Optional[List[ExclusionItem]] = None + """ + An exclusion to apply during preconfigured WAF evaluation. + Structure is documented below. + """ + + +class BanThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class EnforceOnKeyConfig(BaseModel): + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. + HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value. + """ + enforceOnKeyType: Optional[str] = None + """ + Determines the key to enforce the rateLimitThreshold on. Possible values are: + """ + + +class RateLimitThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class RateLimitOptions(BaseModel): + banDurationSec: Optional[float] = None + """ + Can only be specified if the action for the rule is "rate_based_ban". + If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + """ + banThreshold: Optional[BanThreshold] = None + """ + Can only be specified if the action for the rule is "rate_based_ban". + If specified, the key will be banned for the configured 'banDurationSec' when the number of requests that exceed the 'rateLimitThreshold' also exceed this 'banThreshold'. + Structure is documented below. + """ + conformAction: Optional[str] = None + """ + Action to take for requests that are under the configured rate limit threshold. + Valid option is "allow" only. + """ + enforceOnKey: Optional[str] = None + """ + Determines the key to enforce the rateLimitThreshold on. Possible values are: + """ + enforceOnKeyConfigs: Optional[List[EnforceOnKeyConfig]] = None + """ + If specified, any combination of values of enforceOnKeyType/enforceOnKeyName is treated as the key on which ratelimit threshold/action is enforced. + You can specify up to 3 enforceOnKeyConfigs. + If enforceOnKeyConfigs is specified, enforceOnKey must not be specified. + Structure is documented below. + """ + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. + HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value. + """ + exceedAction: Optional[str] = None + """ + Action to take for requests that are above the configured rate limit threshold, to deny with a specified HTTP response code. + Valid options are deny(STATUS), where valid values for STATUS are 403, 404, 429, and 502. + """ + rateLimitThreshold: Optional[RateLimitThreshold] = None + """ + Threshold at which to begin ratelimiting. + Structure is documented below. + """ + + +class Rule(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the rule is matched. The following are the valid actions: + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. + If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + networkMatch: Optional[NetworkMatch] = None + """ + A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. + The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). + Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. + Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. + For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. + Example: + networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" + The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive + Structure is documented below. + """ + preconfiguredWafConfig: Optional[PreconfiguredWafConfig] = None + """ + Preconfigured WAF configuration to be applied for the rule. + If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. + Structure is documented below. + """ + preview: Optional[bool] = None + """ + If set to true, the specified action is not enforced. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority. + """ + rateLimitOptions: Optional[RateLimitOptions] = None + """ + Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions. + Structure is documented below. + """ + + +class UserDefinedFieldModel(BaseModel): + base: Optional[str] = None + """ + The base relative to which 'offset' is measured. Possible values are: + """ + mask: Optional[str] = None + """ + If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. + Encoded as a hexadecimal number (starting with "0x"). + The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + """ + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + offset: Optional[float] = None + """ + Offset of the first byte of the field (in network byte order) relative to 'base'. + """ + size: Optional[float] = None + """ + Size of the field in bytes. Valid values: 1-4. + """ + + +class ForProvider(BaseModel): + ddosProtectionConfig: Optional[DdosProtectionConfig] = None + """ + Configuration for Google Cloud Armor DDOS Proctection Config. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created Region Security Policy should reside. + If it is not provided, the provider region is used. + """ + rules: Optional[List[Rule]] = None + """ + The set of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. + """ + userDefinedFields: Optional[List[UserDefinedFieldModel]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class UserDefinedFieldModel1(BaseModel): + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + values: Optional[List[str]] = None + """ + Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + """ + + +class UserDefinedFieldModel2(BaseModel): + base: Optional[str] = None + """ + The base relative to which 'offset' is measured. Possible values are: + """ + mask: Optional[str] = None + """ + If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. + Encoded as a hexadecimal number (starting with "0x"). + The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + """ + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + offset: Optional[float] = None + """ + Offset of the first byte of the field (in network byte order) relative to 'base'. + """ + size: Optional[float] = None + """ + Size of the field in bytes. Valid values: 1-4. + """ + + +class InitProvider(BaseModel): + ddosProtectionConfig: Optional[DdosProtectionConfig] = None + """ + Configuration for Google Cloud Armor DDOS Proctection Config. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rules: Optional[List[Rule]] = None + """ + The set of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. + """ + userDefinedFields: Optional[List[UserDefinedFieldModel2]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UserDefinedFieldModel3(BaseModel): + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + values: Optional[List[str]] = None + """ + Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + """ + + +class UserDefinedFieldModel4(BaseModel): + base: Optional[str] = None + """ + The base relative to which 'offset' is measured. Possible values are: + """ + mask: Optional[str] = None + """ + If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. + Encoded as a hexadecimal number (starting with "0x"). + The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + """ + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + offset: Optional[float] = None + """ + Offset of the first byte of the field (in network byte order) relative to 'base'. + """ + size: Optional[float] = None + """ + Size of the field in bytes. Valid values: 1-4. + """ + + +class AtProvider(BaseModel): + ddosProtectionConfig: Optional[DdosProtectionConfig] = None + """ + Configuration for Google Cloud Armor DDOS Proctection Config. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. This field is used internally during + updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/securityPolicies/{{name}} + """ + policyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created Region Security Policy should reside. + If it is not provided, the provider region is used. + """ + rules: Optional[List[Rule]] = None + """ + The set of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithPolicyId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. + """ + userDefinedFields: Optional[List[UserDefinedFieldModel4]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionSecurityPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionSecurityPolicy']] = 'RegionSecurityPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionSecurityPolicySpec defines the desired state of RegionSecurityPolicy + """ + status: Optional[Status] = None + """ + RegionSecurityPolicyStatus defines the observed state of RegionSecurityPolicy. + """ + + +class RegionSecurityPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionSecurityPolicy] + """ + List of regionsecuritypolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionsslcertificate/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionsslcertificate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionsslcertificate/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionsslcertificate/v1beta1.py new file mode 100644 index 000000000..305568cf0 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionsslcertificate/v1beta1.py @@ -0,0 +1,317 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionsslcertificate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CertificateSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class PrivateKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class ForProvider(BaseModel): + certificateSecretRef: Optional[CertificateSecretRef] = None + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: Optional[PrivateKeySecretRef] = None + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created regional ssl certificate should reside. + If it is not provided, the provider region is used. + """ + + +class InitProvider(BaseModel): + certificateSecretRef: CertificateSecretRef + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: PrivateKeySecretRef + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateId: Optional[float] = None + """ + The unique identifier for the resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + expireTime: Optional[str] = None + """ + Expire time of the certificate in RFC3339 text format. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/sslCertificates/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created regional ssl certificate should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionSSLCertificate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionSSLCertificate']] = 'RegionSSLCertificate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionSSLCertificateSpec defines the desired state of RegionSSLCertificate + """ + status: Optional[Status] = None + """ + RegionSSLCertificateStatus defines the observed state of RegionSSLCertificate. + """ + + +class RegionSSLCertificateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionSSLCertificate] + """ + List of regionsslcertificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionsslpolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionsslpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionsslpolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionsslpolicy/v1beta1.py new file mode 100644 index 000000000..f9519fd48 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionsslpolicy/v1beta1.py @@ -0,0 +1,228 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionsslpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + customFeatures: Optional[List[str]] = None + description: Optional[str] = None + minTlsVersion: Optional[str] = None + profile: Optional[str] = None + project: Optional[str] = None + region: str + + +class InitProvider(BaseModel): + customFeatures: Optional[List[str]] = None + description: Optional[str] = None + minTlsVersion: Optional[str] = None + profile: Optional[str] = None + project: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + customFeatures: Optional[List[str]] = None + description: Optional[str] = None + enabledFeatures: Optional[List[str]] = None + fingerprint: Optional[str] = None + id: Optional[str] = None + minTlsVersion: Optional[str] = None + profile: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + selfLink: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionSSLPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionSSLPolicy']] = 'RegionSSLPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionSSLPolicySpec defines the desired state of RegionSSLPolicy + """ + status: Optional[Status] = None + """ + RegionSSLPolicyStatus defines the observed state of RegionSSLPolicy. + """ + + +class RegionSSLPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionSSLPolicy] + """ + List of regionsslpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiontargethttpproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regiontargethttpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regiontargethttpproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regiontargethttpproxy/v1beta1.py new file mode 100644 index 000000000..d07262983 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiontargethttpproxy/v1beta1.py @@ -0,0 +1,341 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regiontargethttpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regional + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regional + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regional + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + region: Optional[str] = None + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the BackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionTargetHTTPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionTargetHTTPProxy']] = 'RegionTargetHTTPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionTargetHTTPProxySpec defines the desired state of RegionTargetHTTPProxy + """ + status: Optional[Status] = None + """ + RegionTargetHTTPProxyStatus defines the observed state of RegionTargetHTTPProxy. + """ + + +class RegionTargetHTTPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionTargetHTTPProxy] + """ + List of regiontargethttpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiontargethttpsproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regiontargethttpsproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regiontargethttpsproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regiontargethttpsproxy/v1beta1.py new file mode 100644 index 000000000..8d7e7a656 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiontargethttpsproxy/v1beta1.py @@ -0,0 +1,486 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regiontargethttpsproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SslCertificatesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SslCertificatesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + sslCertificates and certificateManagerCertificates can't be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regioanl + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to RegionSSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of RegionSSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the Region SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the RegionBackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + sslCertificates and certificateManagerCertificates can't be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regioanl + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to RegionSSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of RegionSSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the Region SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the RegionBackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + sslCertificates and certificateManagerCertificates can't be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regioanl + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + region: Optional[str] = None + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + """ + sslPolicy: Optional[str] = None + """ + A reference to the Region SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the RegionBackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionTargetHTTPSProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionTargetHTTPSProxy']] = 'RegionTargetHTTPSProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionTargetHTTPSProxySpec defines the desired state of RegionTargetHTTPSProxy + """ + status: Optional[Status] = None + """ + RegionTargetHTTPSProxyStatus defines the observed state of RegionTargetHTTPSProxy. + """ + + +class RegionTargetHTTPSProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionTargetHTTPSProxy] + """ + List of regiontargethttpsproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regiontargettcpproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regiontargettcpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regiontargettcpproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regiontargettcpproxy/v1beta1.py new file mode 100644 index 000000000..e6ff61228 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regiontargettcpproxy/v1beta1.py @@ -0,0 +1,350 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regiontargettcpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + region: str + """ + The Region in which the created target TCP proxy should reside. + If it is not provided, the provider region is used. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetTcpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + region: Optional[str] = None + """ + The Region in which the created target TCP proxy should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionTargetTCPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionTargetTCPProxy']] = 'RegionTargetTCPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionTargetTCPProxySpec defines the desired state of RegionTargetTCPProxy + """ + status: Optional[Status] = None + """ + RegionTargetTCPProxyStatus defines the observed state of RegionTargetTCPProxy. + """ + + +class RegionTargetTCPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionTargetTCPProxy] + """ + List of regiontargettcpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionurlmap/__init__.py b/schemas/python/models/io/upbound/gcp/compute/regionurlmap/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta1.py new file mode 100644 index 000000000..a5ac0fb69 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta1.py @@ -0,0 +1,2405 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_regionurlmap.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CorsPolicyItem(BaseModel): + allowCredentials: Optional[bool] = None + """ + In response to a preflight request, setting this to true indicates that the + actual request can include user credentials. This translates to the Access- + Control-Allow-Credentials header. Defaults to false. + """ + allowHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Headers header. + """ + allowMethods: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Methods header. + """ + allowOriginRegexes: Optional[List[str]] = None + """ + Specifies the regular expression patterns that match allowed origins. For + regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + An origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + allowOrigins: Optional[List[str]] = None + """ + Specifies the list of origins that will be allowed to do CORS requests. An + origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + disabled: Optional[bool] = None + """ + If true, specifies the CORS policy is disabled. + which indicates that the CORS policy is in effect. Defaults to false. + """ + exposeHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Expose-Headers header. + """ + maxAge: Optional[float] = None + """ + Specifies how long the results of a preflight request can be cached. This + translates to the content for the Access-Control-Max-Age header. + """ + + +class AbortItem(BaseModel): + httpStatus: Optional[float] = None + """ + The HTTP status code used to abort the request. The value must be between 200 + and 599 inclusive. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FixedDelayItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class DelayItem(BaseModel): + fixedDelay: Optional[List[FixedDelayItem]] = None + """ + Specifies the value of the fixed delay interval. + Structure is documented below. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FaultInjectionPolicyItem(BaseModel): + abort: Optional[List[AbortItem]] = None + """ + The specification for how client requests are aborted as part of fault + injection. + Structure is documented below. + """ + delay: Optional[List[DelayItem]] = None + """ + The specification for how client requests are delayed as part of fault + injection, before being sent to a backend service. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RequestMirrorPolicyItem(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + + +class PerTryTimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class RetryPolicyItem(BaseModel): + numRetries: Optional[float] = None + """ + Specifies the allowed number retries. This number must be > 0. + """ + perTryTimeout: Optional[List[PerTryTimeoutItem]] = None + """ + Specifies a non-zero timeout per retry attempt. + Structure is documented below. + """ + retryConditions: Optional[List[str]] = None + """ + Specifies one or more conditions when this retry rule applies. Valid values are: + """ + + +class TimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewriteItem(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class ResponseHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class HeaderActionItem(BaseModel): + requestHeadersToAdd: Optional[List[RequestHeadersToAddItem]] = None + """ + Headers to add to a matching request prior to forwarding the request to the + backendService. + Structure is documented below. + """ + requestHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the request + prior to forwarding the request to the backendService. + """ + responseHeadersToAdd: Optional[List[ResponseHeadersToAddItem]] = None + """ + Headers to add the response prior to sending the response back to the client. + Structure is documented below. + """ + responseHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the response + prior to sending the response back to the client. + """ + + +class WeightedBackendService(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteActionItem(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItem]] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItem]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DefaultServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultUrlRedirectItem(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class HostRuleItem(BaseModel): + description: Optional[str] = None + """ + An optional description of this HostRule. Provide this property + when you create the resource. + """ + hosts: Optional[List[str]] = None + """ + The list of host patterns to match. They must be valid + hostnames, except * will match any string of ([a-z0-9-.]*). In + that case, * must be the first character and must be followed in + the pattern by either - or .. + """ + pathMatcher: Optional[str] = None + """ + The name of the PathMatcher to use to match the path portion of + the URL if the hostRule matches the URL's host portion. + """ + + +class MaxStreamDurationItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewriteItemModel(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionItemModel(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItem]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteItemModel1(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RouteActionItem(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItem]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel1]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlRedirectItem(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class PathRuleItem(BaseModel): + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class RangeMatchItem(BaseModel): + rangeEnd: Optional[float] = None + """ + The end of the range (exclusive). + """ + rangeStart: Optional[float] = None + """ + The start of the range (inclusive). + """ + + +class HeaderMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + headerName: Optional[str] = None + """ + The name of the header. + """ + invertMatch: Optional[bool] = None + """ + If set to false, the headerMatch is considered a match if the match criteria + above are met. If set to true, the headerMatch is considered a match if the + match criteria above are NOT met. Defaults to false. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + rangeMatch: Optional[List[RangeMatchItem]] = None + """ + The header value must be an integer and its value must be in the range specified + in rangeMatch. If the header does not contain an integer, number or is empty, + the match fails. For example for a range [-5, 0] + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + suffixMatch: Optional[str] = None + """ + The value of the header must end with the contents of suffixMatch. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + The value of the label must match the specified value. value can have a maximum + length of 1024 characters. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the provided metadata + based on filterMatchCriteria This list must not be empty and can have at the + most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of filterLabels + contribute towards the overall metadataFilter match. Supported values are: + """ + + +class QueryParameterMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class MatchRule(BaseModel): + fullPathMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request must exactly + match the value specified in fullPathMatch after removing any query parameters + and anchor that may be part of the original URL. FullPathMatch must be between 1 + and 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must + be specified. + """ + headerMatches: Optional[List[HeaderMatch]] = None + """ + Specifies a list of header match criteria, all of which must match corresponding + headers in the request. + Structure is documented below. + """ + ignoreCase: Optional[bool] = None + """ + Specifies that prefixMatch and fullPathMatch matches are case sensitive. + Defaults to false. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing configuration to + a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS + clients present node metadata. If a match takes place, the relevant routing + configuration is made available to those proxies. For each metadataFilter in + this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the + filterLabels must match the corresponding label provided in the metadata. If its + filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match + with corresponding labels in the provided metadata. metadataFilters specified + here can be overrides those specified in ForwardingRule that refers to this + UrlMap. metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + pathTemplateMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request + must match the wildcard pattern specified in pathTemplateMatch + after removing any query parameters and anchor that may be part + of the original URL. + pathTemplateMatch must be between 1 and 255 characters + (inclusive). The pattern specified by pathTemplateMatch may + have at most 5 wildcard operators and at most 5 variable + captures in total. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + queryParameterMatches: Optional[List[QueryParameterMatch]] = None + """ + Specifies a list of query parameter match criteria, all of which must match + corresponding query parameters in the request. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class RequestMirrorPolicyItemModel(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteItemModel2(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteRule(BaseModel): + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItem(BaseModel): + defaultRouteAction: Optional[List[DefaultRouteActionItemModel]] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + A reference to a RegionBackendService resource. This will be used if + none of the pathRules defined by this PathMatcher is matched by + the URL's path portion. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItem]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRule]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItem(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + + +class ForProvider(BaseModel): + defaultRouteAction: Optional[List[DefaultRouteActionItem]] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItem]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the url map should reside. + If it is not provided, the provider region is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class RequestMirrorPolicyItemModel1(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + + +class UrlRewriteItemModel3(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class WeightedBackendServiceModel1(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteActionItemModel1(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel1]] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel3]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel1(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class UrlRewriteItemModel4(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionItemModel2(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel1]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel4]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel2(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteItemModel5(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestMirrorPolicyItemModel2(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteItemModel6(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel2(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class InitProvider(BaseModel): + defaultRouteAction: Optional[List[DefaultRouteActionItemModel1]] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel1]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UrlRewriteItemModel7(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionItemModel3(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel2]] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel7]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel2]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel3(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class UrlRewriteItemModel8(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionItemModel4(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel2]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel8]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel2]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel4(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteItemModel9(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class PathRuleItemModel(BaseModel): + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class UrlRewriteItemModel10(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class RouteRuleModel(BaseModel): + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItemModel(BaseModel): + defaultRouteAction: Optional[List[DefaultRouteActionItemModel4]] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + A reference to a RegionBackendService resource. This will be used if + none of the pathRules defined by this PathMatcher is matched by + the URL's path portion. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel4]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItemModel]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRuleModel]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItemModel(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + defaultRouteAction: Optional[List[DefaultRouteActionItemModel3]] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel3]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. This field is used internally during + updates of this resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/urlMaps/{{name}} + """ + mapId: Optional[float] = None + """ + The unique identifier for the resource. + """ + pathMatcher: Optional[List[PathMatcherItemModel]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the url map should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + test: Optional[List[TestItemModel]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionURLMap(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionURLMap']] = 'RegionURLMap' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionURLMapSpec defines the desired state of RegionURLMap + """ + status: Optional[Status] = None + """ + RegionURLMapStatus defines the observed state of RegionURLMap. + """ + + +class RegionURLMapList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionURLMap] + """ + List of regionurlmaps. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta2.py new file mode 100644 index 000000000..d51c31a92 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/regionurlmap/v1beta2.py @@ -0,0 +1,2405 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_regionurlmap.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CorsPolicy(BaseModel): + allowCredentials: Optional[bool] = None + """ + In response to a preflight request, setting this to true indicates that the + actual request can include user credentials. This translates to the Access- + Control-Allow-Credentials header. Defaults to false. + """ + allowHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Headers header. + """ + allowMethods: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Methods header. + """ + allowOriginRegexes: Optional[List[str]] = None + """ + Specifies the regular expression patterns that match allowed origins. For + regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + An origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + allowOrigins: Optional[List[str]] = None + """ + Specifies the list of origins that will be allowed to do CORS requests. An + origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + disabled: Optional[bool] = None + """ + If true, specifies the CORS policy is disabled. + which indicates that the CORS policy is in effect. Defaults to false. + """ + exposeHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Expose-Headers header. + """ + maxAge: Optional[float] = None + """ + Specifies how long the results of a preflight request can be cached. This + translates to the content for the Access-Control-Max-Age header. + """ + + +class Abort(BaseModel): + httpStatus: Optional[float] = None + """ + The HTTP status code used to abort the request. The value must be between 200 + and 599 inclusive. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FixedDelay(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class Delay(BaseModel): + fixedDelay: Optional[FixedDelay] = None + """ + Specifies the value of the fixed delay interval. + Structure is documented below. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FaultInjectionPolicy(BaseModel): + abort: Optional[Abort] = None + """ + The specification for how client requests are aborted as part of fault + injection. + Structure is documented below. + """ + delay: Optional[Delay] = None + """ + The specification for how client requests are delayed as part of fault + injection, before being sent to a backend service. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RequestMirrorPolicy(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + + +class PerTryTimeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class RetryPolicy(BaseModel): + numRetries: Optional[float] = None + """ + Specifies the allowed number retries. This number must be > 0. + """ + perTryTimeout: Optional[PerTryTimeout] = None + """ + Specifies a non-zero timeout per retry attempt. + Structure is documented below. + """ + retryConditions: Optional[List[str]] = None + """ + Specifies one or more conditions when this retry rule applies. Valid values are: + """ + + +class Timeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewrite(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class ResponseHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class HeaderAction(BaseModel): + requestHeadersToAdd: Optional[List[RequestHeadersToAddItem]] = None + """ + Headers to add to a matching request prior to forwarding the request to the + backendService. + Structure is documented below. + """ + requestHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the request + prior to forwarding the request to the backendService. + """ + responseHeadersToAdd: Optional[List[ResponseHeadersToAddItem]] = None + """ + Headers to add the response prior to sending the response back to the client. + Structure is documented below. + """ + responseHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the response + prior to sending the response back to the client. + """ + + +class WeightedBackendService(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DefaultServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultUrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class HostRuleItem(BaseModel): + description: Optional[str] = None + """ + An optional description of this HostRule. Provide this property + when you create the resource. + """ + hosts: Optional[List[str]] = None + """ + The list of host patterns to match. They must be valid + hostnames, except * will match any string of ([a-z0-9-.]*). In + that case, * must be the first character and must be followed in + the pattern by either - or .. + """ + pathMatcher: Optional[str] = None + """ + The name of the PathMatcher to use to match the path portion of + the URL if the hostRule matches the URL's host portion. + """ + + +class MaxStreamDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewriteModel(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionModel(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteModel1(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel1] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class PathRuleItem(BaseModel): + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class RangeMatch(BaseModel): + rangeEnd: Optional[float] = None + """ + The end of the range (exclusive). + """ + rangeStart: Optional[float] = None + """ + The start of the range (inclusive). + """ + + +class HeaderMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + headerName: Optional[str] = None + """ + The name of the header. + """ + invertMatch: Optional[bool] = None + """ + If set to false, the headerMatch is considered a match if the match criteria + above are met. If set to true, the headerMatch is considered a match if the + match criteria above are NOT met. Defaults to false. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + rangeMatch: Optional[RangeMatch] = None + """ + The header value must be an integer and its value must be in the range specified + in rangeMatch. If the header does not contain an integer, number or is empty, + the match fails. For example for a range [-5, 0] + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + suffixMatch: Optional[str] = None + """ + The value of the header must end with the contents of suffixMatch. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + The value of the label must match the specified value. value can have a maximum + length of 1024 characters. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the provided metadata + based on filterMatchCriteria This list must not be empty and can have at the + most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of filterLabels + contribute towards the overall metadataFilter match. Supported values are: + """ + + +class QueryParameterMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class MatchRule(BaseModel): + fullPathMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request must exactly + match the value specified in fullPathMatch after removing any query parameters + and anchor that may be part of the original URL. FullPathMatch must be between 1 + and 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must + be specified. + """ + headerMatches: Optional[List[HeaderMatch]] = None + """ + Specifies a list of header match criteria, all of which must match corresponding + headers in the request. + Structure is documented below. + """ + ignoreCase: Optional[bool] = None + """ + Specifies that prefixMatch and fullPathMatch matches are case sensitive. + Defaults to false. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing configuration to + a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS + clients present node metadata. If a match takes place, the relevant routing + configuration is made available to those proxies. For each metadataFilter in + this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the + filterLabels must match the corresponding label provided in the metadata. If its + filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match + with corresponding labels in the provided metadata. metadataFilters specified + here can be overrides those specified in ForwardingRule that refers to this + UrlMap. metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + pathTemplateMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request + must match the wildcard pattern specified in pathTemplateMatch + after removing any query parameters and anchor that may be part + of the original URL. + pathTemplateMatch must be between 1 and 255 characters + (inclusive). The pattern specified by pathTemplateMatch may + have at most 5 wildcard operators and at most 5 variable + captures in total. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + queryParameterMatches: Optional[List[QueryParameterMatch]] = None + """ + Specifies a list of query parameter match criteria, all of which must match + corresponding query parameters in the request. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class RequestMirrorPolicyModel(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel2(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteRule(BaseModel): + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItem(BaseModel): + defaultRouteAction: Optional[DefaultRouteActionModel] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + A reference to a RegionBackendService resource. This will be used if + none of the pathRules defined by this PathMatcher is matched by + the URL's path portion. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItem]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRule]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItem(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + + +class ForProvider(BaseModel): + defaultRouteAction: Optional[DefaultRouteAction] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirect] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the url map should reside. + If it is not provided, the provider region is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class RequestMirrorPolicyModel1(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + + +class UrlRewriteModel3(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class WeightedBackendServiceModel1(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteActionModel1(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel3] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel1(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class UrlRewriteModel4(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionModel2(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel4] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel2(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteModel5(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestMirrorPolicyModel2(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel6(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel2(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class InitProvider(BaseModel): + defaultRouteAction: Optional[DefaultRouteActionModel1] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel1] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UrlRewriteModel7(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionModel3(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel7] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel2]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel3(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class UrlRewriteModel8(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionModel4(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel8] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel2]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel4(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteModel9(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class PathRuleItemModel(BaseModel): + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class UrlRewriteModel10(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class RouteRuleModel(BaseModel): + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItemModel(BaseModel): + defaultRouteAction: Optional[DefaultRouteActionModel4] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + A reference to a RegionBackendService resource. This will be used if + none of the pathRules defined by this PathMatcher is matched by + the URL's path portion. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel4] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItemModel]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRuleModel]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItemModel(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + defaultRouteAction: Optional[DefaultRouteActionModel3] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel3] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. This field is used internally during + updates of this resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/urlMaps/{{name}} + """ + mapId: Optional[float] = None + """ + The unique identifier for the resource. + """ + pathMatcher: Optional[List[PathMatcherItemModel]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the url map should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + test: Optional[List[TestItemModel]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionURLMap(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RegionURLMap']] = 'RegionURLMap' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionURLMapSpec defines the desired state of RegionURLMap + """ + status: Optional[Status] = None + """ + RegionURLMapStatus defines the observed state of RegionURLMap. + """ + + +class RegionURLMapList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionURLMap] + """ + List of regionurlmaps. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/reservation/__init__.py b/schemas/python/models/io/upbound/gcp/compute/reservation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/reservation/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/reservation/v1beta1.py new file mode 100644 index 000000000..e2a456a3b --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/reservation/v1beta1.py @@ -0,0 +1,525 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_reservation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class DeleteAfterDurationItem(BaseModel): + nanos: Optional[float] = None + """ + Number of nanoseconds for the auto-delete duration. + """ + seconds: Optional[str] = None + """ + Number of seconds for the auto-delete duration. + """ + + +class ReservationSharingPolicyItem(BaseModel): + serviceShareType: Optional[str] = None + """ + Sharing config for all Google Cloud services. + Possible values are: ALLOW_ALL, DISALLOW_ALL. + """ + + +class ProjectMapItem(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + projectId: Optional[str] = None + """ + The project id/number, should be same as the key of this project config in the project map. + """ + + +class ShareSetting(BaseModel): + projectMap: Optional[List[ProjectMapItem]] = None + """ + A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. + Structure is documented below. + """ + shareType: Optional[str] = None + """ + Type of sharing for this shared-reservation + Possible values are: LOCAL, SPECIFIC_PROJECTS. + """ + + +class GuestAccelerator(BaseModel): + acceleratorCount: Optional[float] = None + """ + The number of the guest accelerator cards exposed to + this instance. + """ + acceleratorType: Optional[str] = None + """ + The full or partial URL of the accelerator type to + attach to this instance. For example: + projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 + If you are creating an instance template, specify only the accelerator name. + """ + + +class LocalSsd(BaseModel): + diskSizeGb: Optional[float] = None + """ + The size of the disk in base-2 GB. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk. + Default value is SCSI. + Possible values are: SCSI, NVME. + """ + + +class InstanceProperty(BaseModel): + guestAccelerators: Optional[List[GuestAccelerator]] = None + """ + Guest accelerator type and count. + Structure is documented below. + """ + localSsds: Optional[List[LocalSsd]] = None + """ + The amount of local ssd to reserve with each instance. This + reserves disks of type local-ssd. + Structure is documented below. + """ + machineType: Optional[str] = None + """ + The name of the machine type to reserve. + """ + minCpuPlatform: Optional[str] = None + """ + The minimum CPU platform for the reservation. For example, + "Intel Skylake". See + the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) + for information on available CPU platforms. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceInstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceInstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SpecificReservationItem(BaseModel): + count: Optional[float] = None + """ + The number of resources that are allocated. + """ + instanceProperties: Optional[List[InstanceProperty]] = None + """ + The instance properties for the reservation. + Structure is documented below. + """ + sourceInstanceTemplate: Optional[str] = None + """ + Specifies the instance template to create the reservation. If you use this field, you must exclude the + instanceProperties field. + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + + +class ForProvider(BaseModel): + deleteAfterDuration: Optional[List[DeleteAfterDurationItem]] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[List[ReservationSharingPolicyItem]] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + shareSettings: Optional[List[ShareSetting]] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[List[SpecificReservationItem]] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + zone: str + """ + The zone where the reservation is made. + """ + + +class InitProvider(BaseModel): + deleteAfterDuration: Optional[List[DeleteAfterDurationItem]] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[List[ReservationSharingPolicyItem]] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + shareSettings: Optional[List[ShareSetting]] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[List[SpecificReservationItem]] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SpecificReservationItemModel(BaseModel): + count: Optional[float] = None + """ + The number of resources that are allocated. + """ + inUseCount: Optional[float] = None + """ + (Output) + How many instances are in use. + """ + instanceProperties: Optional[List[InstanceProperty]] = None + """ + The instance properties for the reservation. + Structure is documented below. + """ + sourceInstanceTemplate: Optional[str] = None + """ + Specifies the instance template to create the reservation. If you use this field, you must exclude the + instanceProperties field. + """ + + +class AtProvider(BaseModel): + commitment: Optional[str] = None + """ + Full or partial URL to a parent commitment. This field displays for + reservations that are tied to a commitment. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + deleteAfterDuration: Optional[List[DeleteAfterDurationItem]] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/reservations/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[List[ReservationSharingPolicyItem]] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shareSettings: Optional[List[ShareSetting]] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[List[SpecificReservationItemModel]] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + status: Optional[str] = None + """ + The status of the reservation. + """ + zone: Optional[str] = None + """ + The zone where the reservation is made. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Reservation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Reservation']] = 'Reservation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ReservationSpec defines the desired state of Reservation + """ + status: Optional[Status] = None + """ + ReservationStatus defines the observed state of Reservation. + """ + + +class ReservationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Reservation] + """ + List of reservations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/reservation/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/reservation/v1beta2.py new file mode 100644 index 000000000..b39049639 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/reservation/v1beta2.py @@ -0,0 +1,525 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_reservation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class DeleteAfterDuration(BaseModel): + nanos: Optional[float] = None + """ + Number of nanoseconds for the auto-delete duration. + """ + seconds: Optional[str] = None + """ + Number of seconds for the auto-delete duration. + """ + + +class ReservationSharingPolicy(BaseModel): + serviceShareType: Optional[str] = None + """ + Sharing config for all Google Cloud services. + Possible values are: ALLOW_ALL, DISALLOW_ALL. + """ + + +class ProjectMapItem(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + projectId: Optional[str] = None + """ + The project id/number, should be same as the key of this project config in the project map. + """ + + +class ShareSettings(BaseModel): + projectMap: Optional[List[ProjectMapItem]] = None + """ + A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. + Structure is documented below. + """ + shareType: Optional[str] = None + """ + Type of sharing for this shared-reservation + Possible values are: LOCAL, SPECIFIC_PROJECTS. + """ + + +class GuestAccelerator(BaseModel): + acceleratorCount: Optional[float] = None + """ + The number of the guest accelerator cards exposed to + this instance. + """ + acceleratorType: Optional[str] = None + """ + The full or partial URL of the accelerator type to + attach to this instance. For example: + projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 + If you are creating an instance template, specify only the accelerator name. + """ + + +class LocalSsd(BaseModel): + diskSizeGb: Optional[float] = None + """ + The size of the disk in base-2 GB. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk. + Default value is SCSI. + Possible values are: SCSI, NVME. + """ + + +class InstanceProperties(BaseModel): + guestAccelerators: Optional[List[GuestAccelerator]] = None + """ + Guest accelerator type and count. + Structure is documented below. + """ + localSsds: Optional[List[LocalSsd]] = None + """ + The amount of local ssd to reserve with each instance. This + reserves disks of type local-ssd. + Structure is documented below. + """ + machineType: Optional[str] = None + """ + The name of the machine type to reserve. + """ + minCpuPlatform: Optional[str] = None + """ + The minimum CPU platform for the reservation. For example, + "Intel Skylake". See + the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) + for information on available CPU platforms. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceInstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceInstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SpecificReservation(BaseModel): + count: Optional[float] = None + """ + The number of resources that are allocated. + """ + instanceProperties: Optional[InstanceProperties] = None + """ + The instance properties for the reservation. + Structure is documented below. + """ + sourceInstanceTemplate: Optional[str] = None + """ + Specifies the instance template to create the reservation. If you use this field, you must exclude the + instanceProperties field. + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + + +class ForProvider(BaseModel): + deleteAfterDuration: Optional[DeleteAfterDuration] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[ReservationSharingPolicy] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + shareSettings: Optional[ShareSettings] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[SpecificReservation] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + zone: str + """ + The zone where the reservation is made. + """ + + +class InitProvider(BaseModel): + deleteAfterDuration: Optional[DeleteAfterDuration] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[ReservationSharingPolicy] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + shareSettings: Optional[ShareSettings] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[SpecificReservation] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SpecificReservationModel(BaseModel): + count: Optional[float] = None + """ + The number of resources that are allocated. + """ + inUseCount: Optional[float] = None + """ + (Output) + How many instances are in use. + """ + instanceProperties: Optional[InstanceProperties] = None + """ + The instance properties for the reservation. + Structure is documented below. + """ + sourceInstanceTemplate: Optional[str] = None + """ + Specifies the instance template to create the reservation. If you use this field, you must exclude the + instanceProperties field. + """ + + +class AtProvider(BaseModel): + commitment: Optional[str] = None + """ + Full or partial URL to a parent commitment. This field displays for + reservations that are tied to a commitment. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + deleteAfterDuration: Optional[DeleteAfterDuration] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/reservations/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[ReservationSharingPolicy] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shareSettings: Optional[ShareSettings] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[SpecificReservationModel] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + status: Optional[str] = None + """ + The status of the reservation. + """ + zone: Optional[str] = None + """ + The zone where the reservation is made. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Reservation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Reservation']] = 'Reservation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ReservationSpec defines the desired state of Reservation + """ + status: Optional[Status] = None + """ + ReservationStatus defines the observed state of Reservation. + """ + + +class ReservationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Reservation] + """ + List of reservations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta1.py new file mode 100644 index 000000000..8c348c605 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta1.py @@ -0,0 +1,533 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_resourcepolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class DiskConsistencyGroupPolicyItem(BaseModel): + enabled: Optional[bool] = None + """ + Enable disk consistency on the resource policy. + """ + + +class GroupPlacementPolicyItem(BaseModel): + availabilityDomainCount: Optional[float] = None + """ + The number of availability domains instances will be spread across. If two instances are in different + availability domain, they will not be put in the same low latency network + """ + collocation: Optional[str] = None + """ + Collocation specifies whether to place VMs inside the same availability domain on the same low-latency network. + Specify COLLOCATED to enable collocation. Can only be specified with vm_count. If compute instances are created + with a COLLOCATED policy, then exactly vm_count instances must be created at the same time with the resource policy + attached. + Possible values are: COLLOCATED. + """ + gpuTopology: Optional[str] = None + """ + Specifies the shape of the GPU slice, in slice based GPU families eg. A4X. + """ + vmCount: Optional[float] = None + """ + Number of VMs in this placement group. Google does not recommend that you use this field + unless you use a compact policy and you want your policy to work only if it contains this + exact number of VMs. + """ + + +class VmStartScheduleItem(BaseModel): + schedule: Optional[str] = None + """ + Specifies the frequency for the operation, using the unix-cron format. + """ + + +class VmStopScheduleItem(BaseModel): + schedule: Optional[str] = None + """ + Specifies the frequency for the operation, using the unix-cron format. + """ + + +class InstanceSchedulePolicyItem(BaseModel): + expirationTime: Optional[str] = None + """ + The expiration time of the schedule. The timestamp is an RFC3339 string. + """ + startTime: Optional[str] = None + """ + The start time of the schedule. The timestamp is an RFC3339 string. + """ + timeZone: Optional[str] = None + """ + Specifies the time zone to be used in interpreting the schedule. The value of this field must be a time zone name + from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + vmStartSchedule: Optional[List[VmStartScheduleItem]] = None + """ + Specifies the schedule for starting instances. + Structure is documented below. + """ + vmStopSchedule: Optional[List[VmStopScheduleItem]] = None + """ + Specifies the schedule for stopping instances. + Structure is documented below. + """ + + +class RetentionPolicyItem(BaseModel): + maxRetentionDays: Optional[float] = None + """ + Maximum age of the snapshot that is allowed to be kept. + """ + onSourceDiskDelete: Optional[str] = None + """ + Specifies the behavior to apply to scheduled snapshots when + the source disk is deleted. + Default value is KEEP_AUTO_SNAPSHOTS. + Possible values are: KEEP_AUTO_SNAPSHOTS, APPLY_RETENTION_POLICY. + """ + + +class DailyScheduleItem(BaseModel): + daysInCycle: Optional[float] = None + """ + Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle. Days in cycle for snapshot schedule policy must be 1. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class HourlyScheduleItem(BaseModel): + hoursInCycle: Optional[float] = None + """ + The number of hours between snapshots. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class DayOfWeek(BaseModel): + day: Optional[str] = None + """ + The day of the week to create the snapshot. e.g. MONDAY + Possible values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class WeeklyScheduleItem(BaseModel): + dayOfWeeks: Optional[List[DayOfWeek]] = None + """ + May contain up to seven (one for each day of the week) snapshot times. + Structure is documented below. + """ + + +class ScheduleItem(BaseModel): + dailySchedule: Optional[List[DailyScheduleItem]] = None + """ + The policy will execute every nth day at the specified time. + Structure is documented below. + """ + hourlySchedule: Optional[List[HourlyScheduleItem]] = None + """ + The policy will execute every nth hour starting at the specified time. + Structure is documented below. + """ + weeklySchedule: Optional[List[WeeklyScheduleItem]] = None + """ + Allows specifying a snapshot time for each day of the week. + Structure is documented below. + """ + + +class SnapshotProperty(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and comply + with RFC1035. + """ + guestFlush: Optional[bool] = None + """ + Whether to perform a 'guest aware' snapshot. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key-value pairs. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket location to store the auto snapshot + (regional or multi-regional) + """ + + +class SnapshotSchedulePolicyItem(BaseModel): + retentionPolicy: Optional[List[RetentionPolicyItem]] = None + """ + Retention policy applied to snapshots created by this resource policy. + Structure is documented below. + """ + schedule: Optional[List[ScheduleItem]] = None + """ + Contains one of an hourlySchedule, dailySchedule, or weeklySchedule. + Structure is documented below. + """ + snapshotProperties: Optional[List[SnapshotProperty]] = None + """ + Properties with which the snapshots are created, such as labels. + Structure is documented below. + """ + + +class WorkloadPolicyItem(BaseModel): + acceleratorTopology: Optional[str] = None + """ + The accelerator topology. This field can be set only when the workload policy type is HIGH_THROUGHPUT + and cannot be set if max topology distance is set. + """ + maxTopologyDistance: Optional[str] = None + """ + The maximum topology distance. This field can be set only when the workload policy type is HIGH_THROUGHPUT + and cannot be set if accelerator topology is set. + Possible values are: BLOCK, CLUSTER, SUBBLOCK. + """ + type: Optional[str] = None + """ + The type of workload policy. + Possible values are: HIGH_AVAILABILITY, HIGH_THROUGHPUT. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[List[DiskConsistencyGroupPolicyItem]] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[List[GroupPlacementPolicyItem]] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + instanceSchedulePolicy: Optional[List[InstanceSchedulePolicyItem]] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where resource policy resides. + """ + snapshotSchedulePolicy: Optional[List[SnapshotSchedulePolicyItem]] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[List[WorkloadPolicyItem]] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[List[DiskConsistencyGroupPolicyItem]] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[List[GroupPlacementPolicyItem]] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + instanceSchedulePolicy: Optional[List[InstanceSchedulePolicyItem]] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotSchedulePolicy: Optional[List[SnapshotSchedulePolicyItem]] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[List[WorkloadPolicyItem]] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[List[DiskConsistencyGroupPolicyItem]] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[List[GroupPlacementPolicyItem]] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/resourcePolicies/{{name}} + """ + instanceSchedulePolicy: Optional[List[InstanceSchedulePolicyItem]] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where resource policy resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + snapshotSchedulePolicy: Optional[List[SnapshotSchedulePolicyItem]] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[List[WorkloadPolicyItem]] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ResourcePolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ResourcePolicy']] = 'ResourcePolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ResourcePolicySpec defines the desired state of ResourcePolicy + """ + status: Optional[Status] = None + """ + ResourcePolicyStatus defines the observed state of ResourcePolicy. + """ + + +class ResourcePolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ResourcePolicy] + """ + List of resourcepolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta2.py new file mode 100644 index 000000000..c7d175ead --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/resourcepolicy/v1beta2.py @@ -0,0 +1,533 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_resourcepolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class DiskConsistencyGroupPolicy(BaseModel): + enabled: Optional[bool] = None + """ + Enable disk consistency on the resource policy. + """ + + +class GroupPlacementPolicy(BaseModel): + availabilityDomainCount: Optional[float] = None + """ + The number of availability domains instances will be spread across. If two instances are in different + availability domain, they will not be put in the same low latency network + """ + collocation: Optional[str] = None + """ + Collocation specifies whether to place VMs inside the same availability domain on the same low-latency network. + Specify COLLOCATED to enable collocation. Can only be specified with vm_count. If compute instances are created + with a COLLOCATED policy, then exactly vm_count instances must be created at the same time with the resource policy + attached. + Possible values are: COLLOCATED. + """ + gpuTopology: Optional[str] = None + """ + Specifies the shape of the GPU slice, in slice based GPU families eg. A4X. + """ + vmCount: Optional[float] = None + """ + Number of VMs in this placement group. Google does not recommend that you use this field + unless you use a compact policy and you want your policy to work only if it contains this + exact number of VMs. + """ + + +class VmStartSchedule(BaseModel): + schedule: Optional[str] = None + """ + Specifies the frequency for the operation, using the unix-cron format. + """ + + +class VmStopSchedule(BaseModel): + schedule: Optional[str] = None + """ + Specifies the frequency for the operation, using the unix-cron format. + """ + + +class InstanceSchedulePolicy(BaseModel): + expirationTime: Optional[str] = None + """ + The expiration time of the schedule. The timestamp is an RFC3339 string. + """ + startTime: Optional[str] = None + """ + The start time of the schedule. The timestamp is an RFC3339 string. + """ + timeZone: Optional[str] = None + """ + Specifies the time zone to be used in interpreting the schedule. The value of this field must be a time zone name + from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + vmStartSchedule: Optional[VmStartSchedule] = None + """ + Specifies the schedule for starting instances. + Structure is documented below. + """ + vmStopSchedule: Optional[VmStopSchedule] = None + """ + Specifies the schedule for stopping instances. + Structure is documented below. + """ + + +class RetentionPolicy(BaseModel): + maxRetentionDays: Optional[float] = None + """ + Maximum age of the snapshot that is allowed to be kept. + """ + onSourceDiskDelete: Optional[str] = None + """ + Specifies the behavior to apply to scheduled snapshots when + the source disk is deleted. + Default value is KEEP_AUTO_SNAPSHOTS. + Possible values are: KEEP_AUTO_SNAPSHOTS, APPLY_RETENTION_POLICY. + """ + + +class DailySchedule(BaseModel): + daysInCycle: Optional[float] = None + """ + Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle. Days in cycle for snapshot schedule policy must be 1. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class HourlySchedule(BaseModel): + hoursInCycle: Optional[float] = None + """ + The number of hours between snapshots. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class DayOfWeek(BaseModel): + day: Optional[str] = None + """ + The day of the week to create the snapshot. e.g. MONDAY + Possible values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class WeeklySchedule(BaseModel): + dayOfWeeks: Optional[List[DayOfWeek]] = None + """ + May contain up to seven (one for each day of the week) snapshot times. + Structure is documented below. + """ + + +class Schedule(BaseModel): + dailySchedule: Optional[DailySchedule] = None + """ + The policy will execute every nth day at the specified time. + Structure is documented below. + """ + hourlySchedule: Optional[HourlySchedule] = None + """ + The policy will execute every nth hour starting at the specified time. + Structure is documented below. + """ + weeklySchedule: Optional[WeeklySchedule] = None + """ + Allows specifying a snapshot time for each day of the week. + Structure is documented below. + """ + + +class SnapshotProperties(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and comply + with RFC1035. + """ + guestFlush: Optional[bool] = None + """ + Whether to perform a 'guest aware' snapshot. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key-value pairs. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket location to store the auto snapshot + (regional or multi-regional) + """ + + +class SnapshotSchedulePolicy(BaseModel): + retentionPolicy: Optional[RetentionPolicy] = None + """ + Retention policy applied to snapshots created by this resource policy. + Structure is documented below. + """ + schedule: Optional[Schedule] = None + """ + Contains one of an hourlySchedule, dailySchedule, or weeklySchedule. + Structure is documented below. + """ + snapshotProperties: Optional[SnapshotProperties] = None + """ + Properties with which the snapshots are created, such as labels. + Structure is documented below. + """ + + +class WorkloadPolicy(BaseModel): + acceleratorTopology: Optional[str] = None + """ + The accelerator topology. This field can be set only when the workload policy type is HIGH_THROUGHPUT + and cannot be set if max topology distance is set. + """ + maxTopologyDistance: Optional[str] = None + """ + The maximum topology distance. This field can be set only when the workload policy type is HIGH_THROUGHPUT + and cannot be set if accelerator topology is set. + Possible values are: BLOCK, CLUSTER, SUBBLOCK. + """ + type: Optional[str] = None + """ + The type of workload policy. + Possible values are: HIGH_AVAILABILITY, HIGH_THROUGHPUT. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[DiskConsistencyGroupPolicy] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[GroupPlacementPolicy] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + instanceSchedulePolicy: Optional[InstanceSchedulePolicy] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where resource policy resides. + """ + snapshotSchedulePolicy: Optional[SnapshotSchedulePolicy] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[WorkloadPolicy] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[DiskConsistencyGroupPolicy] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[GroupPlacementPolicy] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + instanceSchedulePolicy: Optional[InstanceSchedulePolicy] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotSchedulePolicy: Optional[SnapshotSchedulePolicy] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[WorkloadPolicy] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[DiskConsistencyGroupPolicy] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[GroupPlacementPolicy] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/resourcePolicies/{{name}} + """ + instanceSchedulePolicy: Optional[InstanceSchedulePolicy] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where resource policy resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + snapshotSchedulePolicy: Optional[SnapshotSchedulePolicy] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[WorkloadPolicy] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ResourcePolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['ResourcePolicy']] = 'ResourcePolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ResourcePolicySpec defines the desired state of ResourcePolicy + """ + status: Optional[Status] = None + """ + ResourcePolicyStatus defines the observed state of ResourcePolicy. + """ + + +class ResourcePolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ResourcePolicy] + """ + List of resourcepolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/route/__init__.py b/schemas/python/models/io/upbound/gcp/compute/route/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/route/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/route/v1beta1.py new file mode 100644 index 000000000..62c892638 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/route/v1beta1.py @@ -0,0 +1,651 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_route.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NextHopIlbRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NextHopIlbSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NextHopVpnTunnelRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NextHopVpnTunnelSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the route. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property + when you create the resource. + """ + destRange: Optional[str] = None + """ + The destination range of outgoing packets that this route applies to. + Only IPv4 is supported. + """ + network: Optional[str] = None + """ + The network that this route applies to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nextHopGateway: Optional[str] = None + """ + URL to a gateway that should handle matching packets. + Currently, you can only specify the internet gateway, using a full or + partial valid URL: + """ + nextHopIlb: Optional[str] = None + """ + The IP address or URL to a forwarding rule of type + loadBalancingScheme=INTERNAL that should handle matching + packets. + With the GA provider you can only specify the forwarding + rule as a partial or full URL. For example, the following + are all valid values: + """ + nextHopIlbRef: Optional[NextHopIlbRef] = None + """ + Reference to a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopIlbSelector: Optional[NextHopIlbSelector] = None + """ + Selector for a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopInstance: Optional[str] = None + """ + URL to an instance that should handle matching packets. + You can specify this as a full or partial URL. For example: + """ + nextHopInstanceZone: Optional[str] = None + """ + . + """ + nextHopIp: Optional[str] = None + """ + Network IP address of an instance that should handle matching packets. + """ + nextHopVpnTunnel: Optional[str] = None + """ + URL to a VpnTunnel that should handle matching packets. + """ + nextHopVpnTunnelRef: Optional[NextHopVpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + nextHopVpnTunnelSelector: Optional[NextHopVpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + The priority of this route. Priority is used to break ties in cases + where there is more than one matching route of equal prefix length. + In the case of two routes with equal prefix length, the one with the + lowest-numbered priority value wins. + Default value is 1000. Valid range is 0 through 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + tags: Optional[List[str]] = None + """ + A list of instance tags to which this route applies. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property + when you create the resource. + """ + destRange: Optional[str] = None + """ + The destination range of outgoing packets that this route applies to. + Only IPv4 is supported. + """ + network: Optional[str] = None + """ + The network that this route applies to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nextHopGateway: Optional[str] = None + """ + URL to a gateway that should handle matching packets. + Currently, you can only specify the internet gateway, using a full or + partial valid URL: + """ + nextHopIlb: Optional[str] = None + """ + The IP address or URL to a forwarding rule of type + loadBalancingScheme=INTERNAL that should handle matching + packets. + With the GA provider you can only specify the forwarding + rule as a partial or full URL. For example, the following + are all valid values: + """ + nextHopIlbRef: Optional[NextHopIlbRef] = None + """ + Reference to a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopIlbSelector: Optional[NextHopIlbSelector] = None + """ + Selector for a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopInstance: Optional[str] = None + """ + URL to an instance that should handle matching packets. + You can specify this as a full or partial URL. For example: + """ + nextHopInstanceZone: Optional[str] = None + """ + . + """ + nextHopIp: Optional[str] = None + """ + Network IP address of an instance that should handle matching packets. + """ + nextHopVpnTunnel: Optional[str] = None + """ + URL to a VpnTunnel that should handle matching packets. + """ + nextHopVpnTunnelRef: Optional[NextHopVpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + nextHopVpnTunnelSelector: Optional[NextHopVpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + The priority of this route. Priority is used to break ties in cases + where there is more than one matching route of equal prefix length. + In the case of two routes with equal prefix length, the one with the + lowest-numbered priority value wins. + Default value is 1000. Valid range is 0 through 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + tags: Optional[List[str]] = None + """ + A list of instance tags to which this route applies. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsPath(BaseModel): + asLists: Optional[List[float]] = None + """ + (Output) + The AS numbers of the AS Path. + """ + pathSegmentType: Optional[str] = None + """ + (Output) + The type of the AS Path, which can be one of the following values: + """ + + +class Datum(BaseModel): + key: Optional[str] = None + """ + (Output) + A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + """ + value: Optional[str] = None + """ + (Output) + A warning data value corresponding to the key. + """ + + +class Warning(BaseModel): + code: Optional[str] = None + """ + (Output) + A warning code, if applicable. For example, Compute Engine returns + NO_RESULTS_ON_PAGE if there are no results in the response. + """ + data: Optional[List[Datum]] = None + """ + (Output) + Metadata about this warning in key: value format. For example: + "data": [ { "key": "scope", "value": "zones/us-east1-d" } + Structure is documented below. + """ + message: Optional[str] = None + """ + (Output) + A human-readable description of the warning code. + """ + + +class AtProvider(BaseModel): + asPaths: Optional[List[AsPath]] = None + """ + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property + when you create the resource. + """ + destRange: Optional[str] = None + """ + The destination range of outgoing packets that this route applies to. + Only IPv4 is supported. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/routes/{{name}} + """ + network: Optional[str] = None + """ + The network that this route applies to. + """ + nextHopGateway: Optional[str] = None + """ + URL to a gateway that should handle matching packets. + Currently, you can only specify the internet gateway, using a full or + partial valid URL: + """ + nextHopHub: Optional[str] = None + """ + The hub network that should handle matching packets, which should conform to RFC1035. + """ + nextHopIlb: Optional[str] = None + """ + The IP address or URL to a forwarding rule of type + loadBalancingScheme=INTERNAL that should handle matching + packets. + With the GA provider you can only specify the forwarding + rule as a partial or full URL. For example, the following + are all valid values: + """ + nextHopInstance: Optional[str] = None + """ + URL to an instance that should handle matching packets. + You can specify this as a full or partial URL. For example: + """ + nextHopInstanceZone: Optional[str] = None + """ + . + """ + nextHopInterRegionCost: Optional[str] = None + """ + Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions. + """ + nextHopIp: Optional[str] = None + """ + Network IP address of an instance that should handle matching packets. + """ + nextHopMed: Optional[str] = None + """ + Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network. + """ + nextHopNetwork: Optional[str] = None + """ + URL to a Network that should handle matching packets. + """ + nextHopOrigin: Optional[str] = None + """ + Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE. + """ + nextHopPeering: Optional[str] = None + """ + The network peering name that should handle matching packets, which should conform to RFC1035. + """ + nextHopVpnTunnel: Optional[str] = None + """ + URL to a VpnTunnel that should handle matching packets. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + The priority of this route. Priority is used to break ties in cases + where there is more than one matching route of equal prefix length. + In the case of two routes with equal prefix length, the one with the + lowest-numbered priority value wins. + Default value is 1000. Valid range is 0 through 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routeStatus: Optional[str] = None + """ + The status of the route, which can be one of the following values: + """ + routeType: Optional[str] = None + """ + The type of this route, which can be one of the following values: + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + tags: Optional[List[str]] = None + """ + A list of instance tags to which this route applies. + """ + warnings: Optional[List[Warning]] = None + """ + If potential misconfigurations are detected for this route, this field will be populated with warning messages. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Route(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Route']] = 'Route' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouteSpec defines the desired state of Route + """ + status: Optional[Status] = None + """ + RouteStatus defines the observed state of Route. + """ + + +class RouteList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Route] + """ + List of routes. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/router/__init__.py b/schemas/python/models/io/upbound/gcp/compute/router/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/router/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/router/v1beta1.py new file mode 100644 index 000000000..64f6141c9 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/router/v1beta1.py @@ -0,0 +1,431 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_router.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvertisedIpRange(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + range: Optional[str] = None + """ + The IP range to advertise. The value must be a + CIDR-formatted string. + """ + + +class BgpItem(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom mode. + This field can only be populated if advertiseMode is CUSTOM and + is advertised to all peers of the router. These groups will be + advertised in addition to any specified prefixes. Leave this field + blank to advertise no custom groups. + This enum field has the one valid value: ALL_SUBNETS + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + asn: Optional[float] = None + """ + Local BGP Autonomous System Number (ASN). Must be an RFC6996 + private ASN, either 16-bit or 32-bit. The value will be fixed for + this router resource. All VPN tunnels that link to this router + will have the same local ASN. + """ + identifierRange: Optional[str] = None + """ + Explicitly specifies a range of valid BGP Identifiers for this Router. + It is provided as a link-local IPv4 range (from 169.254.0.0/16), of + size at least /30, even if the BGP sessions are over IPv6. It must + not overlap with any IPv4 BGP session ranges. Other vendors commonly + call this router ID. + """ + keepaliveInterval: Optional[float] = None + """ + The interval in seconds between BGP keepalive messages that are sent + to the peer. Hold time is three times the interval at which keepalive + messages are sent, and the hold time is the maximum number of seconds + allowed to elapse between successive keepalive messages that BGP + receives from a peer. + BGP will use the smaller of either the local hold time value or the + peer's hold time value as the hold time for the BGP connection + between the two peers. If set, this value must be between 20 and 60. + The default is 20. + """ + + +class Md5AuthenticationKey(BaseModel): + key: Optional[str] = None + """ + Value of the key used for MD5 authentication. + """ + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. + Must be referenced by exactly one bgpPeer. Must comply with RFC1035. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bgp: Optional[List[BgpItem]] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + md5AuthenticationKeys: Optional[List[Md5AuthenticationKey]] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the router resides. + """ + + +class InitProvider(BaseModel): + bgp: Optional[List[BgpItem]] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + md5AuthenticationKeys: Optional[List[Md5AuthenticationKey]] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bgp: Optional[List[BgpItem]] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{name}} + """ + md5AuthenticationKeys: Optional[List[Md5AuthenticationKey]] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Router(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Router']] = 'Router' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterSpec defines the desired state of Router + """ + status: Optional[Status] = None + """ + RouterStatus defines the observed state of Router. + """ + + +class RouterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Router] + """ + List of routers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/router/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/router/v1beta2.py new file mode 100644 index 000000000..f7754291a --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/router/v1beta2.py @@ -0,0 +1,431 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_router.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvertisedIpRange(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + range: Optional[str] = None + """ + The IP range to advertise. The value must be a + CIDR-formatted string. + """ + + +class Bgp(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom mode. + This field can only be populated if advertiseMode is CUSTOM and + is advertised to all peers of the router. These groups will be + advertised in addition to any specified prefixes. Leave this field + blank to advertise no custom groups. + This enum field has the one valid value: ALL_SUBNETS + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + asn: Optional[float] = None + """ + Local BGP Autonomous System Number (ASN). Must be an RFC6996 + private ASN, either 16-bit or 32-bit. The value will be fixed for + this router resource. All VPN tunnels that link to this router + will have the same local ASN. + """ + identifierRange: Optional[str] = None + """ + Explicitly specifies a range of valid BGP Identifiers for this Router. + It is provided as a link-local IPv4 range (from 169.254.0.0/16), of + size at least /30, even if the BGP sessions are over IPv6. It must + not overlap with any IPv4 BGP session ranges. Other vendors commonly + call this router ID. + """ + keepaliveInterval: Optional[float] = None + """ + The interval in seconds between BGP keepalive messages that are sent + to the peer. Hold time is three times the interval at which keepalive + messages are sent, and the hold time is the maximum number of seconds + allowed to elapse between successive keepalive messages that BGP + receives from a peer. + BGP will use the smaller of either the local hold time value or the + peer's hold time value as the hold time for the BGP connection + between the two peers. If set, this value must be between 20 and 60. + The default is 20. + """ + + +class Md5AuthenticationKeys(BaseModel): + key: Optional[str] = None + """ + Value of the key used for MD5 authentication. + """ + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. + Must be referenced by exactly one bgpPeer. Must comply with RFC1035. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bgp: Optional[Bgp] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + md5AuthenticationKeys: Optional[Md5AuthenticationKeys] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the router resides. + """ + + +class InitProvider(BaseModel): + bgp: Optional[Bgp] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + md5AuthenticationKeys: Optional[Md5AuthenticationKeys] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bgp: Optional[Bgp] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{name}} + """ + md5AuthenticationKeys: Optional[Md5AuthenticationKeys] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Router(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Router']] = 'Router' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterSpec defines the desired state of Router + """ + status: Optional[Status] = None + """ + RouterStatus defines the observed state of Router. + """ + + +class RouterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Router] + """ + List of routers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/routerinterface/__init__.py b/schemas/python/models/io/upbound/gcp/compute/routerinterface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/routerinterface/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/routerinterface/v1beta1.py new file mode 100644 index 000000000..a31b6fbb2 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/routerinterface/v1beta1.py @@ -0,0 +1,464 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_routerinterface.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class VpnTunnelRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class VpnTunnelSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + interconnectAttachment: Optional[str] = None + """ + The name or resource link to the + VLAN interconnect for this interface. Changing this forces a new interface to + be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + ipRange: Optional[str] = None + """ + IP address and range of the interface. The IP range must be + in the RFC3927 link-local IP space. Changing this forces a new interface to be created. + """ + ipVersion: Optional[str] = None + """ + IP version of this interface. Can be either IPV4 or IPV6. + """ + name: Optional[str] = None + """ + A unique name for the interface, required by GCE. Changing + this forces a new interface to be created. + """ + privateIpAddress: Optional[str] = None + """ + The regional private internal IP address that is used + to establish BGP sessions to a VM instance acting as a third-party Router Appliance. Changing this forces a new interface to be created. + """ + project: Optional[str] = None + """ + The ID of the project in which this interface's router belongs. + If it is not provided, the provider project is used. Changing this forces a new interface to be created. + """ + redundantInterface: Optional[str] = None + """ + The name of the interface that is redundant to + this interface. Changing this forces a new interface to be created. + """ + region: Optional[str] = None + """ + The region this interface's router sits in. + If not specified, the project region will be used. Changing this forces a new interface to be created. + """ + router: Optional[str] = None + """ + The name of the router this interface will be attached to. + Changing this forces a new interface to be created. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + subnetwork: Optional[str] = None + """ + The URI of the subnetwork resource that this interface + belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. Changing this forces a new interface to be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnel: Optional[str] = None + """ + The name or resource link to the VPN tunnel this + interface will be linked to. Changing this forces a new interface to be created. Only + one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnelRef: Optional[VpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate vpnTunnel. + """ + vpnTunnelSelector: Optional[VpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate vpnTunnel. + """ + + +class InitProvider(BaseModel): + interconnectAttachment: Optional[str] = None + """ + The name or resource link to the + VLAN interconnect for this interface. Changing this forces a new interface to + be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + ipRange: Optional[str] = None + """ + IP address and range of the interface. The IP range must be + in the RFC3927 link-local IP space. Changing this forces a new interface to be created. + """ + ipVersion: Optional[str] = None + """ + IP version of this interface. Can be either IPV4 or IPV6. + """ + name: Optional[str] = None + """ + A unique name for the interface, required by GCE. Changing + this forces a new interface to be created. + """ + privateIpAddress: Optional[str] = None + """ + The regional private internal IP address that is used + to establish BGP sessions to a VM instance acting as a third-party Router Appliance. Changing this forces a new interface to be created. + """ + project: Optional[str] = None + """ + The ID of the project in which this interface's router belongs. + If it is not provided, the provider project is used. Changing this forces a new interface to be created. + """ + redundantInterface: Optional[str] = None + """ + The name of the interface that is redundant to + this interface. Changing this forces a new interface to be created. + """ + region: Optional[str] = None + """ + The region this interface's router sits in. + If not specified, the project region will be used. Changing this forces a new interface to be created. + """ + router: Optional[str] = None + """ + The name of the router this interface will be attached to. + Changing this forces a new interface to be created. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + subnetwork: Optional[str] = None + """ + The URI of the subnetwork resource that this interface + belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. Changing this forces a new interface to be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnel: Optional[str] = None + """ + The name or resource link to the VPN tunnel this + interface will be linked to. Changing this forces a new interface to be created. Only + one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnelRef: Optional[VpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate vpnTunnel. + """ + vpnTunnelSelector: Optional[VpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate vpnTunnel. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{region}}/{{router}}/{{name}} + """ + interconnectAttachment: Optional[str] = None + """ + The name or resource link to the + VLAN interconnect for this interface. Changing this forces a new interface to + be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + ipRange: Optional[str] = None + """ + IP address and range of the interface. The IP range must be + in the RFC3927 link-local IP space. Changing this forces a new interface to be created. + """ + ipVersion: Optional[str] = None + """ + IP version of this interface. Can be either IPV4 or IPV6. + """ + name: Optional[str] = None + """ + A unique name for the interface, required by GCE. Changing + this forces a new interface to be created. + """ + privateIpAddress: Optional[str] = None + """ + The regional private internal IP address that is used + to establish BGP sessions to a VM instance acting as a third-party Router Appliance. Changing this forces a new interface to be created. + """ + project: Optional[str] = None + """ + The ID of the project in which this interface's router belongs. + If it is not provided, the provider project is used. Changing this forces a new interface to be created. + """ + redundantInterface: Optional[str] = None + """ + The name of the interface that is redundant to + this interface. Changing this forces a new interface to be created. + """ + region: Optional[str] = None + """ + The region this interface's router sits in. + If not specified, the project region will be used. Changing this forces a new interface to be created. + """ + router: Optional[str] = None + """ + The name of the router this interface will be attached to. + Changing this forces a new interface to be created. + """ + subnetwork: Optional[str] = None + """ + The URI of the subnetwork resource that this interface + belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. Changing this forces a new interface to be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnel: Optional[str] = None + """ + The name or resource link to the VPN tunnel this + interface will be linked to. Changing this forces a new interface to be created. Only + one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterInterface(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RouterInterface']] = 'RouterInterface' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterInterfaceSpec defines the desired state of RouterInterface + """ + status: Optional[Status] = None + """ + RouterInterfaceStatus defines the observed state of RouterInterface. + """ + + +class RouterInterfaceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterInterface] + """ + List of routerinterfaces. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/routernat/__init__.py b/schemas/python/models/io/upbound/gcp/compute/routernat/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/routernat/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/routernat/v1beta1.py new file mode 100644 index 000000000..72ef1770f --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/routernat/v1beta1.py @@ -0,0 +1,882 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_routernat.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class LogConfigItem(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. + """ + filter: Optional[str] = None + """ + Specifies the desired filtering of logs on this NAT. + Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NatIpsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NatIpsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceNatActiveIpsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceNatActiveIpsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceNatActiveRangesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceNatActiveRangesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ActionItem(BaseModel): + sourceNatActiveIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources used for this NAT rule. + These IP addresses must be valid static external IP addresses assigned to the project. + This field is used for public NAT. + """ + sourceNatActiveIpsRefs: Optional[List[SourceNatActiveIpsRef]] = None + """ + References to Address in compute to populate sourceNatActiveIps. + """ + sourceNatActiveIpsSelector: Optional[SourceNatActiveIpsSelector] = None + """ + Selector for a list of Address in compute to populate sourceNatActiveIps. + """ + sourceNatActiveRanges: Optional[List[str]] = None + """ + A list of URLs of the subnetworks used as source ranges for this NAT Rule. + These subnetworks must have purpose set to PRIVATE_NAT. + This field is used for private NAT. + """ + sourceNatActiveRangesRefs: Optional[List[SourceNatActiveRangesRef]] = None + """ + References to Subnetwork in compute to populate sourceNatActiveRanges. + """ + sourceNatActiveRangesSelector: Optional[SourceNatActiveRangesSelector] = None + """ + Selector for a list of Subnetwork in compute to populate sourceNatActiveRanges. + """ + sourceNatDrainIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. + These IPs must be valid static external IPs that have been assigned to the NAT. + These IPs should be used for updating/patching a NAT rule only. + This field is used for public NAT. + """ + sourceNatDrainRanges: Optional[List[str]] = None + """ + A list of URLs of subnetworks representing source ranges to be drained. + This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. + This field is used for private NAT. + """ + + +class Rule(BaseModel): + action: Optional[List[ActionItem]] = None + """ + The action to be enforced for traffic that matches this rule. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this rule. + """ + match: Optional[str] = None + """ + CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. + If it evaluates to true, the corresponding action is enforced. + The following examples are valid match expressions for public NAT: + "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" + "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" + The following example is a valid match expression for private NAT: + "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'" + """ + ruleNumber: Optional[float] = None + """ + An integer uniquely identifying a rule in the list. + The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkItem(BaseModel): + name: Optional[str] = None + """ + Self-link of subnetwork to NAT + """ + nameRef: Optional[NameRef] = None + """ + Reference to a Subnetwork in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Subnetwork in compute to populate name. + """ + secondaryIpRangeNames: Optional[List[str]] = None + """ + List of the secondary ranges of the subnetwork that are allowed + to use NAT. This can be populated only if + LIST_OF_SECONDARY_IP_RANGES is one of the values in + sourceIpRangesToNat + """ + sourceIpRangesToNat: Optional[List[str]] = None + """ + List of options for which source IPs in the subnetwork + should have NAT enabled. Supported values include: + ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, + PRIMARY_IP_RANGE. + """ + + +class ForProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + """ + natIpsRefs: Optional[List[NatIpsRef]] = None + """ + References to Address in compute to populate natIps. + """ + natIpsSelector: Optional[NatIpsSelector] = None + """ + Selector for a list of Address in compute to populate natIps. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the router and NAT reside. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this NAT will be configured. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class InitProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + """ + natIpsRefs: Optional[List[NatIpsRef]] = None + """ + References to Address in compute to populate natIps. + """ + natIpsSelector: Optional[NatIpsSelector] = None + """ + Selector for a list of Address in compute to populate natIps. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ActionItemModel(BaseModel): + sourceNatActiveIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources used for this NAT rule. + These IP addresses must be valid static external IP addresses assigned to the project. + This field is used for public NAT. + """ + sourceNatActiveRanges: Optional[List[str]] = None + """ + A list of URLs of the subnetworks used as source ranges for this NAT Rule. + These subnetworks must have purpose set to PRIVATE_NAT. + This field is used for private NAT. + """ + sourceNatDrainIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. + These IPs must be valid static external IPs that have been assigned to the NAT. + These IPs should be used for updating/patching a NAT rule only. + This field is used for public NAT. + """ + sourceNatDrainRanges: Optional[List[str]] = None + """ + A list of URLs of subnetworks representing source ranges to be drained. + This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. + This field is used for private NAT. + """ + + +class SubnetworkItemModel(BaseModel): + name: Optional[str] = None + """ + Self-link of subnetwork to NAT + """ + secondaryIpRangeNames: Optional[List[str]] = None + """ + List of the secondary ranges of the subnetwork that are allowed + to use NAT. This can be populated only if + LIST_OF_SECONDARY_IP_RANGES is one of the values in + sourceIpRangesToNat + """ + sourceIpRangesToNat: Optional[List[str]] = None + """ + List of options for which source IPs in the subnetwork + should have NAT enabled. Supported values include: + ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, + PRIMARY_IP_RANGE. + """ + + +class AtProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{router}}/{{name}} + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and NAT reside. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this NAT will be configured. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItemModel]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterNAT(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RouterNAT']] = 'RouterNAT' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterNATSpec defines the desired state of RouterNAT + """ + status: Optional[Status] = None + """ + RouterNATStatus defines the observed state of RouterNAT. + """ + + +class RouterNATList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterNAT] + """ + List of routernats. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/routernat/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/routernat/v1beta2.py new file mode 100644 index 000000000..f5cf6e932 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/routernat/v1beta2.py @@ -0,0 +1,985 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_routernat.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. + """ + filter: Optional[str] = None + """ + Specifies the desired filtering of logs on this NAT. + Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL. + """ + + +class Nat64SubnetworkItem(BaseModel): + name: Optional[str] = None + """ + Self-link of the subnetwork resource that will use NAT64 + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NatIpsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NatIpsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceNatActiveIpsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceNatActiveIpsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceNatActiveRangesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceNatActiveRangesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Action(BaseModel): + sourceNatActiveIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources used for this NAT rule. + These IP addresses must be valid static external IP addresses assigned to the project. + This field is used for public NAT. + """ + sourceNatActiveIpsRefs: Optional[List[SourceNatActiveIpsRef]] = None + """ + References to Address in compute to populate sourceNatActiveIps. + """ + sourceNatActiveIpsSelector: Optional[SourceNatActiveIpsSelector] = None + """ + Selector for a list of Address in compute to populate sourceNatActiveIps. + """ + sourceNatActiveRanges: Optional[List[str]] = None + """ + A list of URLs of the subnetworks used as source ranges for this NAT Rule. + These subnetworks must have purpose set to PRIVATE_NAT. + This field is used for private NAT. + """ + sourceNatActiveRangesRefs: Optional[List[SourceNatActiveRangesRef]] = None + """ + References to Subnetwork in compute to populate sourceNatActiveRanges. + """ + sourceNatActiveRangesSelector: Optional[SourceNatActiveRangesSelector] = None + """ + Selector for a list of Subnetwork in compute to populate sourceNatActiveRanges. + """ + sourceNatDrainIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. + These IPs must be valid static external IPs that have been assigned to the NAT. + These IPs should be used for updating/patching a NAT rule only. + This field is used for public NAT. + """ + sourceNatDrainRanges: Optional[List[str]] = None + """ + A list of URLs of subnetworks representing source ranges to be drained. + This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. + This field is used for private NAT. + """ + + +class Rule(BaseModel): + action: Optional[Action] = None + """ + The action to be enforced for traffic that matches this rule. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this rule. + """ + match: Optional[str] = None + """ + CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. + If it evaluates to true, the corresponding action is enforced. + The following examples are valid match expressions for public NAT: + "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" + "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" + The following example is a valid match expression for private NAT: + "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'" + """ + ruleNumber: Optional[float] = None + """ + An integer uniquely identifying a rule in the list. + The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkItem(BaseModel): + name: Optional[str] = None + """ + Self-link of subnetwork to NAT + """ + nameRef: Optional[NameRef] = None + """ + Reference to a Subnetwork in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Subnetwork in compute to populate name. + """ + secondaryIpRangeNames: Optional[List[str]] = None + """ + List of the secondary ranges of the subnetwork that are allowed + to use NAT. This can be populated only if + LIST_OF_SECONDARY_IP_RANGES is one of the values in + sourceIpRangesToNat + """ + sourceIpRangesToNat: Optional[List[str]] = None + """ + List of options for which source IPs in the subnetwork + should have NAT enabled. Supported values include: + ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, + PRIMARY_IP_RANGE. + """ + + +class ForProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + initialNatIps: Optional[List[str]] = None + """ + Self-links of NAT IPs to be used as initial value for creation alongside a RouterNatAddress resource. + Conflicts with natIps and drainNatIps. Only valid if natIpAllocateOption is set to MANUAL_ONLY. + """ + logConfig: Optional[LogConfig] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + nat64Subnetwork: Optional[List[Nat64SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations whose traffic should be translated by NAT64 Gateway. + Only used if source_subnetwork_ip_ranges_to_nat64 is set to LIST_OF_IPV6_SUBNETWORKS + Structure is documented below. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + If this field is used alongside with a count created list of address resources google_compute_address.foobar.*.self_link, + the access level resource for the address resource must have a lifecycle block with create_before_destroy = true so + the number of resources can be increased/decreased without triggering the resourceInUseByAnotherResource error. + """ + natIpsRefs: Optional[List[NatIpsRef]] = None + """ + References to Address in compute to populate natIps. + """ + natIpsSelector: Optional[NatIpsSelector] = None + """ + Selector for a list of Address in compute to populate natIps. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the router and NAT reside. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this NAT will be configured. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + sourceSubnetworkIpRangesToNat64: Optional[str] = None + """ + Specify the Nat option for NAT64, which can take one of the following values: + ALL_IPV6_SUBNETWORKS: All of the IP ranges in every Subnetwork are allowed to Nat. + LIST_OF_IPV6_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field nat64Subnetwork below). + Note that if this field contains NAT64_ALL_V6_SUBNETWORKS no other Router.Nat section in this region can also enable NAT64 for any Subnetworks in this network. + Other Router.Nat sections can still be present to enable NAT44 only. + Possible values are: ALL_IPV6_SUBNETWORKS, LIST_OF_IPV6_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + type: Optional[str] = None + """ + Indicates whether this NAT is used for public or private IP translation. + If unspecified, it defaults to PUBLIC. + If PUBLIC NAT used for public IP translation. + If PRIVATE NAT used for private IP translation. + Default value is PUBLIC. + Possible values are: PUBLIC, PRIVATE. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class InitProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + initialNatIps: Optional[List[str]] = None + """ + Self-links of NAT IPs to be used as initial value for creation alongside a RouterNatAddress resource. + Conflicts with natIps and drainNatIps. Only valid if natIpAllocateOption is set to MANUAL_ONLY. + """ + logConfig: Optional[LogConfig] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + nat64Subnetwork: Optional[List[Nat64SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations whose traffic should be translated by NAT64 Gateway. + Only used if source_subnetwork_ip_ranges_to_nat64 is set to LIST_OF_IPV6_SUBNETWORKS + Structure is documented below. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + If this field is used alongside with a count created list of address resources google_compute_address.foobar.*.self_link, + the access level resource for the address resource must have a lifecycle block with create_before_destroy = true so + the number of resources can be increased/decreased without triggering the resourceInUseByAnotherResource error. + """ + natIpsRefs: Optional[List[NatIpsRef]] = None + """ + References to Address in compute to populate natIps. + """ + natIpsSelector: Optional[NatIpsSelector] = None + """ + Selector for a list of Address in compute to populate natIps. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + sourceSubnetworkIpRangesToNat64: Optional[str] = None + """ + Specify the Nat option for NAT64, which can take one of the following values: + ALL_IPV6_SUBNETWORKS: All of the IP ranges in every Subnetwork are allowed to Nat. + LIST_OF_IPV6_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field nat64Subnetwork below). + Note that if this field contains NAT64_ALL_V6_SUBNETWORKS no other Router.Nat section in this region can also enable NAT64 for any Subnetworks in this network. + Other Router.Nat sections can still be present to enable NAT44 only. + Possible values are: ALL_IPV6_SUBNETWORKS, LIST_OF_IPV6_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + type: Optional[str] = None + """ + Indicates whether this NAT is used for public or private IP translation. + If unspecified, it defaults to PUBLIC. + If PUBLIC NAT used for public IP translation. + If PRIVATE NAT used for private IP translation. + Default value is PUBLIC. + Possible values are: PUBLIC, PRIVATE. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ActionModel(BaseModel): + sourceNatActiveIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources used for this NAT rule. + These IP addresses must be valid static external IP addresses assigned to the project. + This field is used for public NAT. + """ + sourceNatActiveRanges: Optional[List[str]] = None + """ + A list of URLs of the subnetworks used as source ranges for this NAT Rule. + These subnetworks must have purpose set to PRIVATE_NAT. + This field is used for private NAT. + """ + sourceNatDrainIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. + These IPs must be valid static external IPs that have been assigned to the NAT. + These IPs should be used for updating/patching a NAT rule only. + This field is used for public NAT. + """ + sourceNatDrainRanges: Optional[List[str]] = None + """ + A list of URLs of subnetworks representing source ranges to be drained. + This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. + This field is used for private NAT. + """ + + +class SubnetworkItemModel(BaseModel): + name: Optional[str] = None + """ + Self-link of subnetwork to NAT + """ + secondaryIpRangeNames: Optional[List[str]] = None + """ + List of the secondary ranges of the subnetwork that are allowed + to use NAT. This can be populated only if + LIST_OF_SECONDARY_IP_RANGES is one of the values in + sourceIpRangesToNat + """ + sourceIpRangesToNat: Optional[List[str]] = None + """ + List of options for which source IPs in the subnetwork + should have NAT enabled. Supported values include: + ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, + PRIMARY_IP_RANGE. + """ + + +class AtProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{router}}/{{name}} + """ + initialNatIps: Optional[List[str]] = None + """ + Self-links of NAT IPs to be used as initial value for creation alongside a RouterNatAddress resource. + Conflicts with natIps and drainNatIps. Only valid if natIpAllocateOption is set to MANUAL_ONLY. + """ + logConfig: Optional[LogConfig] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + nat64Subnetwork: Optional[List[Nat64SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations whose traffic should be translated by NAT64 Gateway. + Only used if source_subnetwork_ip_ranges_to_nat64 is set to LIST_OF_IPV6_SUBNETWORKS + Structure is documented below. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + If this field is used alongside with a count created list of address resources google_compute_address.foobar.*.self_link, + the access level resource for the address resource must have a lifecycle block with create_before_destroy = true so + the number of resources can be increased/decreased without triggering the resourceInUseByAnotherResource error. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and NAT reside. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this NAT will be configured. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + sourceSubnetworkIpRangesToNat64: Optional[str] = None + """ + Specify the Nat option for NAT64, which can take one of the following values: + ALL_IPV6_SUBNETWORKS: All of the IP ranges in every Subnetwork are allowed to Nat. + LIST_OF_IPV6_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field nat64Subnetwork below). + Note that if this field contains NAT64_ALL_V6_SUBNETWORKS no other Router.Nat section in this region can also enable NAT64 for any Subnetworks in this network. + Other Router.Nat sections can still be present to enable NAT44 only. + Possible values are: ALL_IPV6_SUBNETWORKS, LIST_OF_IPV6_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItemModel]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + type: Optional[str] = None + """ + Indicates whether this NAT is used for public or private IP translation. + If unspecified, it defaults to PUBLIC. + If PUBLIC NAT used for public IP translation. + If PRIVATE NAT used for private IP translation. + Default value is PUBLIC. + Possible values are: PUBLIC, PRIVATE. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterNAT(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RouterNAT']] = 'RouterNAT' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterNATSpec defines the desired state of RouterNAT + """ + status: Optional[Status] = None + """ + RouterNATStatus defines the observed state of RouterNAT. + """ + + +class RouterNATList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterNAT] + """ + List of routernats. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/routerpeer/__init__.py b/schemas/python/models/io/upbound/gcp/compute/routerpeer/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta1.py new file mode 100644 index 000000000..8e9dc450f --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta1.py @@ -0,0 +1,912 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_routerpeer.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvertisedIpRange(BaseModel): + description: Optional[str] = None + """ + User-specified description for the IP range. + """ + range: Optional[str] = None + """ + The IP range to advertise. The value must be a + CIDR-formatted string. + """ + + +class BfdItem(BaseModel): + minReceiveInterval: Optional[float] = None + """ + The minimum interval, in milliseconds, between BFD control packets + received from the peer router. The actual value is negotiated + between the two routers and is equal to the greater of this value + and the transmit interval of the other router. If set, this value + must be between 1000 and 30000. + """ + minTransmitInterval: Optional[float] = None + """ + The minimum interval, in milliseconds, between BFD control packets + transmitted to the peer router. The actual value is negotiated + between the two routers and is equal to the greater of this value + and the corresponding receive interval of the other router. If set, + this value must be between 1000 and 30000. + """ + multiplier: Optional[float] = None + """ + The number of consecutive BFD packets that must be missed before + BFD declares that a peer is unavailable. If set, the value must + be a value between 5 and 16. + """ + sessionInitializationMode: Optional[str] = None + """ + The BFD session initialization mode for this BGP peer. + If set to ACTIVE, the Cloud Router will initiate the BFD session + for this BGP peer. If set to PASSIVE, the Cloud Router will wait + for the peer router to initiate the BFD session for this BGP peer. + If set to DISABLED, BFD is disabled for this BGP peer. + Possible values are: ACTIVE, DISABLED, PASSIVE. + """ + + +class CustomLearnedIpRange(BaseModel): + range: Optional[str] = None + """ + The IP range to advertise. The value must be a + CIDR-formatted string. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InterfaceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InterfaceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class KeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Md5AuthenticationKeyItem(BaseModel): + keySecretRef: KeySecretRef + """ + A SecretKeySelector is a reference to a secret key in an arbitrary namespace. + """ + name: Optional[str] = None + """ + Name of this BGP peer. The name must be 1-63 characters long, + and comply with RFC1035. Specifically, the name must be 1-63 characters + long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which + means the first character must be a lowercase letter, and all + following characters must be a dash, lowercase letter, or digit, + except the last character, which cannot be a dash. + """ + + +class PeerIpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeerIpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RegionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterApplianceInstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterApplianceInstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[List[BfdItem]] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + customLearnedRoutePriority: Optional[float] = None + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + interfaceRef: Optional[InterfaceRef] = None + """ + Reference to a RouterInterface in compute to populate interface. + """ + interfaceSelector: Optional[InterfaceSelector] = None + """ + Selector for a RouterInterface in compute to populate interface. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + md5AuthenticationKey: Optional[List[Md5AuthenticationKeyItem]] = None + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpAddressRef: Optional[PeerIpAddressRef] = None + """ + Reference to a Address in compute to populate peerIpAddress. + """ + peerIpAddressSelector: Optional[PeerIpAddressSelector] = None + """ + Selector for a Address in compute to populate peerIpAddress. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a Router in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a Router in compute to populate region. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this BgpPeer will be configured. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + routerApplianceInstanceRef: Optional[RouterApplianceInstanceRef] = None + """ + Reference to a Instance in compute to populate routerApplianceInstance. + """ + routerApplianceInstanceSelector: Optional[RouterApplianceInstanceSelector] = None + """ + Selector for a Instance in compute to populate routerApplianceInstance. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class Md5AuthenticationKeyItemModel(BaseModel): + name: Optional[str] = None + """ + Name of this BGP peer. The name must be 1-63 characters long, + and comply with RFC1035. Specifically, the name must be 1-63 characters + long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which + means the first character must be a lowercase letter, and all + following characters must be a dash, lowercase letter, or digit, + except the last character, which cannot be a dash. + """ + + +class InitProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[List[BfdItem]] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + customLearnedRoutePriority: Optional[float] = None + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + interfaceRef: Optional[InterfaceRef] = None + """ + Reference to a RouterInterface in compute to populate interface. + """ + interfaceSelector: Optional[InterfaceSelector] = None + """ + Selector for a RouterInterface in compute to populate interface. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + md5AuthenticationKey: Optional[List[Md5AuthenticationKeyItemModel]] = None + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpAddressRef: Optional[PeerIpAddressRef] = None + """ + Reference to a Address in compute to populate peerIpAddress. + """ + peerIpAddressSelector: Optional[PeerIpAddressSelector] = None + """ + Selector for a Address in compute to populate peerIpAddress. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a Router in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a Router in compute to populate region. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + routerApplianceInstanceRef: Optional[RouterApplianceInstanceRef] = None + """ + Reference to a Instance in compute to populate routerApplianceInstance. + """ + routerApplianceInstanceSelector: Optional[RouterApplianceInstanceSelector] = None + """ + Selector for a Instance in compute to populate routerApplianceInstance. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[List[BfdItem]] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + customLearnedRoutePriority: Optional[float] = None + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}} + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + isAdvertisedRoutePrioritySet: Optional[bool] = None + isCustomLearnedPrioritySet: Optional[bool] = None + managementType: Optional[str] = None + """ + The resource that configures and manages this BGP peer. + """ + md5AuthenticationKey: Optional[List[Md5AuthenticationKeyItemModel]] = None + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this BgpPeer will be configured. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterPeer(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['RouterPeer']] = 'RouterPeer' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterPeerSpec defines the desired state of RouterPeer + """ + status: Optional[Status] = None + """ + RouterPeerStatus defines the observed state of RouterPeer. + """ + + +class RouterPeerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterPeer] + """ + List of routerpeers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta2.py new file mode 100644 index 000000000..9f81df589 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/routerpeer/v1beta2.py @@ -0,0 +1,961 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_routerpeer.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvertisedIpRange(BaseModel): + description: Optional[str] = None + """ + User-specified description for the IP range. + """ + range: Optional[str] = None + """ + The IP range to advertise. The value must be a + CIDR-formatted string. + """ + + +class Bfd(BaseModel): + minReceiveInterval: Optional[float] = None + """ + The minimum interval, in milliseconds, between BFD control packets + received from the peer router. The actual value is negotiated + between the two routers and is equal to the greater of this value + and the transmit interval of the other router. If set, this value + must be between 1000 and 30000. + """ + minTransmitInterval: Optional[float] = None + """ + The minimum interval, in milliseconds, between BFD control packets + transmitted to the peer router. The actual value is negotiated + between the two routers and is equal to the greater of this value + and the corresponding receive interval of the other router. If set, + this value must be between 1000 and 30000. + """ + multiplier: Optional[float] = None + """ + The number of consecutive BFD packets that must be missed before + BFD declares that a peer is unavailable. If set, the value must + be a value between 5 and 16. + """ + sessionInitializationMode: Optional[str] = None + """ + The BFD session initialization mode for this BGP peer. + If set to ACTIVE, the Cloud Router will initiate the BFD session + for this BGP peer. If set to PASSIVE, the Cloud Router will wait + for the peer router to initiate the BFD session for this BGP peer. + If set to DISABLED, BFD is disabled for this BGP peer. + Possible values are: ACTIVE, DISABLED, PASSIVE. + """ + + +class CustomLearnedIpRange(BaseModel): + range: Optional[str] = None + """ + The IP range to learn. The value must be a + CIDR-formatted string. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InterfaceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InterfaceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class KeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Md5AuthenticationKey(BaseModel): + keySecretRef: Optional[KeySecretRef] = None + """ + The MD5 authentication key for this BGP peer. Maximum length is 80 characters. Can only contain printable ASCII characters + """ + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. Must comply with RFC1035. + """ + + +class PeerIpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeerIpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RegionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterApplianceInstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterApplianceInstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[Bfd] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + """ + The custom learned route IP address range. Must be a valid CIDR-formatted prefix. + If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, + a /32 singular IP address range, and, for IPv6, /128. + Structure is documented below. + """ + customLearnedRoutePriority: Optional[float] = None + """ + The user-defined custom learned route priority for a BGP session. + This value is applied to all custom learned route ranges for the session. + You can choose a value from 0 to 65335. If you don't provide a value, + Google Cloud assigns a priority of 100 to the ranges. + """ + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + interfaceRef: Optional[InterfaceRef] = None + """ + Reference to a RouterInterface in compute to populate interface. + """ + interfaceSelector: Optional[InterfaceSelector] = None + """ + Selector for a RouterInterface in compute to populate interface. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + md5AuthenticationKey: Optional[Md5AuthenticationKey] = None + """ + Configuration for MD5 authentication on the BGP session. + Structure is documented below. + """ + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpAddressRef: Optional[PeerIpAddressRef] = None + """ + Reference to a Address in compute to populate peerIpAddress. + """ + peerIpAddressSelector: Optional[PeerIpAddressSelector] = None + """ + Selector for a Address in compute to populate peerIpAddress. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a Router in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a Router in compute to populate region. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this BgpPeer will be configured. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + routerApplianceInstanceRef: Optional[RouterApplianceInstanceRef] = None + """ + Reference to a Instance in compute to populate routerApplianceInstance. + """ + routerApplianceInstanceSelector: Optional[RouterApplianceInstanceSelector] = None + """ + Selector for a Instance in compute to populate routerApplianceInstance. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class Md5AuthenticationKeyModel(BaseModel): + keySecretRef: KeySecretRef + """ + The MD5 authentication key for this BGP peer. Maximum length is 80 characters. Can only contain printable ASCII characters + """ + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. Must comply with RFC1035. + """ + + +class InitProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[Bfd] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + """ + The custom learned route IP address range. Must be a valid CIDR-formatted prefix. + If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, + a /32 singular IP address range, and, for IPv6, /128. + Structure is documented below. + """ + customLearnedRoutePriority: Optional[float] = None + """ + The user-defined custom learned route priority for a BGP session. + This value is applied to all custom learned route ranges for the session. + You can choose a value from 0 to 65335. If you don't provide a value, + Google Cloud assigns a priority of 100 to the ranges. + """ + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + interfaceRef: Optional[InterfaceRef] = None + """ + Reference to a RouterInterface in compute to populate interface. + """ + interfaceSelector: Optional[InterfaceSelector] = None + """ + Selector for a RouterInterface in compute to populate interface. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + md5AuthenticationKey: Optional[Md5AuthenticationKeyModel] = None + """ + Configuration for MD5 authentication on the BGP session. + Structure is documented below. + """ + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpAddressRef: Optional[PeerIpAddressRef] = None + """ + Reference to a Address in compute to populate peerIpAddress. + """ + peerIpAddressSelector: Optional[PeerIpAddressSelector] = None + """ + Selector for a Address in compute to populate peerIpAddress. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a Router in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a Router in compute to populate region. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + routerApplianceInstanceRef: Optional[RouterApplianceInstanceRef] = None + """ + Reference to a Instance in compute to populate routerApplianceInstance. + """ + routerApplianceInstanceSelector: Optional[RouterApplianceInstanceSelector] = None + """ + Selector for a Instance in compute to populate routerApplianceInstance. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class Md5AuthenticationKeyModel1(BaseModel): + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. Must comply with RFC1035. + """ + + +class AtProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[Bfd] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + """ + The custom learned route IP address range. Must be a valid CIDR-formatted prefix. + If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, + a /32 singular IP address range, and, for IPv6, /128. + Structure is documented below. + """ + customLearnedRoutePriority: Optional[float] = None + """ + The user-defined custom learned route priority for a BGP session. + This value is applied to all custom learned route ranges for the session. + You can choose a value from 0 to 65335. If you don't provide a value, + Google Cloud assigns a priority of 100 to the ranges. + """ + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}} + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + isAdvertisedRoutePrioritySet: Optional[bool] = None + isCustomLearnedPrioritySet: Optional[bool] = None + managementType: Optional[str] = None + """ + The resource that configures and manages this BGP peer. + """ + md5AuthenticationKey: Optional[Md5AuthenticationKeyModel1] = None + """ + Configuration for MD5 authentication on the BGP session. + Structure is documented below. + """ + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this BgpPeer will be configured. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterPeer(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['RouterPeer']] = 'RouterPeer' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterPeerSpec defines the desired state of RouterPeer + """ + status: Optional[Status] = None + """ + RouterPeerStatus defines the observed state of RouterPeer. + """ + + +class RouterPeerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterPeer] + """ + List of routerpeers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/securitypolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/securitypolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta1.py new file mode 100644 index 000000000..6c682aeed --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta1.py @@ -0,0 +1,724 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_securitypolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class TrafficGranularityConfig(BaseModel): + enableEachUniqueValue: Optional[bool] = None + """ + If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if value is empty. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class ThresholdConfig(BaseModel): + autoDeployConfidenceThreshold: Optional[float] = None + """ + Confidence threshold above which Adaptive Protection's auto-deploy takes actions. + """ + autoDeployExpirationSec: Optional[float] = None + """ + Duration over which Adaptive Protection's auto-deployed actions last. + """ + autoDeployImpactedBaselineThreshold: Optional[float] = None + """ + Impacted baseline threshold below which Adaptive Protection's auto-deploy takes actions. + """ + autoDeployLoadThreshold: Optional[float] = None + """ + Load threshold above which Adaptive Protection automatically deploy threshold based on the backend load threshold and detect a new rule during an alerted attack. + """ + detectionAbsoluteQps: Optional[float] = None + """ + Detection threshold based on absolute QPS. + """ + detectionLoadThreshold: Optional[float] = None + """ + Detection threshold based on the backend service's load. + """ + detectionRelativeToBaselineQps: Optional[float] = None + """ + Detection threshold based on QPS relative to the average of baseline traffic. + """ + name: Optional[str] = None + """ + The name of config. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + """ + trafficGranularityConfigs: Optional[List[TrafficGranularityConfig]] = None + """ + Configuration options for enabling Adaptive Protection to work on the specified service granularity. Structure is documented below. + """ + + +class Layer7DdosDefenseConfigItem(BaseModel): + enable: Optional[bool] = None + """ + If set to true, enables CAAP for L7 DDoS detection. + """ + ruleVisibility: Optional[str] = None + """ + Rule visibility can be one of the following: + """ + thresholdConfigs: Optional[List[ThresholdConfig]] = None + """ + Configuration options for layer7 adaptive protection for various customizable thresholds. Structure is documented below. + """ + + +class AdaptiveProtectionConfigItem(BaseModel): + layer7DdosDefenseConfig: Optional[List[Layer7DdosDefenseConfigItem]] = None + """ + Configuration for Google Cloud Armor Adaptive Protection Layer 7 DDoS Defense. Structure is documented below. + """ + + +class JsonCustomConfigItem(BaseModel): + contentTypes: Optional[List[str]] = None + """ + A list of custom Content-Type header values to apply the JSON parsing. The + format of the Content-Type header values is defined in + RFC 1341. When configuring a custom Content-Type header + value, only the type/subtype needs to be specified, and the parameters should be excluded. + """ + + +class AdvancedOptionsConfigItem(BaseModel): + jsonCustomConfig: Optional[List[JsonCustomConfigItem]] = None + """ + Custom configuration to apply the JSON parsing. Only applicable when + json_parsing is set to STANDARD. Structure is documented below. + """ + jsonParsing: Optional[str] = None + """ + Whether or not to JSON parse the payload body. Defaults to DISABLED. + """ + logLevel: Optional[str] = None + """ + Log level to use. Defaults to NORMAL. + """ + userIpRequestHeaders: Optional[List[str]] = None + """ + An optional list of case-insensitive request header names to use for resolving the callers client IP address. + """ + + +class RecaptchaOptionsConfigItem(BaseModel): + redirectSiteKey: Optional[str] = None + """ + A field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. + """ + + +class RequestHeadersToAdd(BaseModel): + headerName: Optional[str] = None + """ + The name of the header to set. + """ + headerValue: Optional[str] = None + """ + The value to set the named header to. + """ + + +class HeaderActionItem(BaseModel): + requestHeadersToAdds: Optional[List[RequestHeadersToAdd]] = None + """ + The list of request headers to add or overwrite if they're already present. Structure is documented below. + """ + + +class ConfigItem(BaseModel): + srcIpRanges: Optional[List[str]] = None + """ + Set of IP addresses or ranges (IPV4 or IPV6) in CIDR notation + to match against inbound traffic. There is a limit of 10 IP ranges per rule. A value of * matches all IPs + (can be used to override the default behavior). + """ + + +class ExprItem(BaseModel): + expression: Optional[str] = None + """ + Textual representation of an expression in Common Expression Language syntax. + The application context of the containing message determines which well-known feature set of CEL is supported. + """ + + +class RecaptchaOption(BaseModel): + actionTokenSiteKeys: Optional[List[str]] = None + """ + A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + """ + sessionTokenSiteKeys: Optional[List[str]] = None + """ + A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + """ + + +class ExprOption(BaseModel): + recaptchaOptions: Optional[List[RecaptchaOption]] = None + """ + reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect. + Structure is documented below. + """ + + +class MatchItem(BaseModel): + config: Optional[List[ConfigItem]] = None + """ + The configuration options available when specifying versioned_expr. + This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + Structure is documented below. + """ + expr: Optional[List[ExprItem]] = None + """ + User defined CEVAL expression. A CEVAL expression is used to specify match criteria + such as origin.ip, source.region_code and contents in the request header. + Structure is documented below. + """ + exprOptions: Optional[List[ExprOption]] = None + """ + The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr'). + Structure is documented below. + """ + versionedExpr: Optional[str] = None + """ + Predefined rule expression. If this field is specified, config must also be specified. + Available options: + """ + + +class RequestCookieItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestHeaderItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestQueryParamItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestUriItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class ExclusionItem(BaseModel): + requestCookie: Optional[List[RequestCookieItem]] = None + """ + Request cookie whose value will be excluded from inspection during preconfigured WAF evaluation. Structure is documented below. + """ + requestHeader: Optional[List[RequestHeaderItem]] = None + """ + Request header whose value will be excluded from inspection during preconfigured WAF evaluation. Structure is documented below. + """ + requestQueryParam: Optional[List[RequestQueryParamItem]] = None + """ + Request query parameter whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body. Structure is documented below. + """ + requestUri: Optional[List[RequestUriItem]] = None + """ + Request URI from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded. Structure is documented below. + """ + targetRuleIds: Optional[List[str]] = None + """ + A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set. + """ + targetRuleSet: Optional[str] = None + """ + Target WAF rule set to apply the preconfigured WAF exclusion. + """ + + +class PreconfiguredWafConfigItem(BaseModel): + exclusion: Optional[List[ExclusionItem]] = None + """ + An exclusion to apply during preconfigured WAF evaluation. Structure is documented below. + """ + + +class BanThresholdItem(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class EnforceOnKeyConfig(BaseModel): + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + """ + enforceOnKeyType: Optional[str] = None + """ + Determines the key to enforce the rate_limit_threshold on. If not specified, defaults to ALL. + """ + + +class ExceedRedirectOption(BaseModel): + target: Optional[str] = None + """ + External redirection target when EXTERNAL_302 is set in type. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class RateLimitThresholdItem(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class RateLimitOption(BaseModel): + banDurationSec: Optional[float] = None + """ + Can only be specified if the action for the rule is rate_based_ban. + If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + """ + banThreshold: Optional[List[BanThresholdItem]] = None + """ + Can only be specified if the action for the rule is rate_based_ban. + If specified, the key will be banned for the configured ban_duration_sec when the number of requests that exceed the rate_limit_threshold also + exceed this ban_threshold. Structure is documented below. + """ + conformAction: Optional[str] = None + """ + Action to take for requests that are under the configured rate limit threshold. Valid option is allow only. + """ + enforceOnKey: Optional[str] = None + """ + Determines the key to enforce the rate_limit_threshold on. If not specified, defaults to ALL. + """ + enforceOnKeyConfigs: Optional[List[EnforceOnKeyConfig]] = None + """ + If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which rate limit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must be set to an empty string. Structure is documented below. + """ + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + """ + exceedAction: Optional[str] = None + """ + When a request is denied, returns the HTTP response code specified. + Valid options are deny() where valid values for status are 403, 404, 429, and 502. + """ + exceedRedirectOptions: Optional[List[ExceedRedirectOption]] = None + """ + Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. Structure is documented below. + """ + rateLimitThreshold: Optional[List[RateLimitThresholdItem]] = None + """ + Threshold at which to begin ratelimiting. Structure is documented below. + """ + + +class RedirectOption(BaseModel): + target: Optional[str] = None + """ + External redirection target when EXTERNAL_302 is set in type. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class RuleItem(BaseModel): + action: Optional[str] = None + """ + Action to take when match matches the request. Valid values: + """ + description: Optional[str] = None + """ + An optional description of this rule. Max size is 64. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Additional actions that are performed on headers. Structure is documented below. + """ + match: Optional[List[MatchItem]] = None + """ + A match condition that incoming traffic is evaluated against. + If it evaluates to true, the corresponding action is enforced. Structure is documented below. + """ + preconfiguredWafConfig: Optional[List[PreconfiguredWafConfigItem]] = None + """ + Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. Structure is documented below. + """ + preview: Optional[bool] = None + """ + When set to true, the action specified above is not enforced. + Stackdriver logs for requests that trigger a preview action are annotated as such. + """ + priority: Optional[float] = None + """ + An unique positive integer indicating the priority of evaluation for a rule. + Rules are evaluated from highest priority (lowest numerically) to lowest priority (highest numerically) in order. + """ + rateLimitOptions: Optional[List[RateLimitOption]] = None + """ + Must be specified if the action is rate_based_ban or throttle. Cannot be specified for other actions. Structure is documented below. + """ + redirectOptions: Optional[List[RedirectOption]] = None + """ + Can be specified if the action is redirect. Cannot be specified for other actions. Structure is documented below. + """ + + +class ForProvider(BaseModel): + adaptiveProtectionConfig: Optional[List[AdaptiveProtectionConfigItem]] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[List[AdvancedOptionsConfigItem]] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[List[RecaptchaOptionsConfigItem]] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class InitProvider(BaseModel): + adaptiveProtectionConfig: Optional[List[AdaptiveProtectionConfigItem]] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[List[AdvancedOptionsConfigItem]] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[List[RecaptchaOptionsConfigItem]] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + adaptiveProtectionConfig: Optional[List[AdaptiveProtectionConfigItem]] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[List[AdvancedOptionsConfigItem]] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/securityPolicies/{{name}} + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[List[RecaptchaOptionsConfigItem]] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SecurityPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['SecurityPolicy']] = 'SecurityPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SecurityPolicySpec defines the desired state of SecurityPolicy + """ + status: Optional[Status] = None + """ + SecurityPolicyStatus defines the observed state of SecurityPolicy. + """ + + +class SecurityPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SecurityPolicy] + """ + List of securitypolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta2.py new file mode 100644 index 000000000..b1ee7d55a --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/securitypolicy/v1beta2.py @@ -0,0 +1,724 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_securitypolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class TrafficGranularityConfig(BaseModel): + enableEachUniqueValue: Optional[bool] = None + """ + If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if value is empty. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class ThresholdConfig(BaseModel): + autoDeployConfidenceThreshold: Optional[float] = None + """ + Confidence threshold above which Adaptive Protection's auto-deploy takes actions. + """ + autoDeployExpirationSec: Optional[float] = None + """ + Duration over which Adaptive Protection's auto-deployed actions last. + """ + autoDeployImpactedBaselineThreshold: Optional[float] = None + """ + Impacted baseline threshold below which Adaptive Protection's auto-deploy takes actions. + """ + autoDeployLoadThreshold: Optional[float] = None + """ + Load threshold above which Adaptive Protection automatically deploy threshold based on the backend load threshold and detect a new rule during an alerted attack. + """ + detectionAbsoluteQps: Optional[float] = None + """ + Detection threshold based on absolute QPS. + """ + detectionLoadThreshold: Optional[float] = None + """ + Detection threshold based on the backend service's load. + """ + detectionRelativeToBaselineQps: Optional[float] = None + """ + Detection threshold based on QPS relative to the average of baseline traffic. + """ + name: Optional[str] = None + """ + The name of config. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + """ + trafficGranularityConfigs: Optional[List[TrafficGranularityConfig]] = None + """ + Configuration options for enabling Adaptive Protection to work on the specified service granularity. Structure is documented below. + """ + + +class Layer7DdosDefenseConfig(BaseModel): + enable: Optional[bool] = None + """ + If set to true, enables CAAP for L7 DDoS detection. + """ + ruleVisibility: Optional[str] = None + """ + Rule visibility can be one of the following: + """ + thresholdConfigs: Optional[List[ThresholdConfig]] = None + """ + Configuration options for layer7 adaptive protection for various customizable thresholds. Structure is documented below. + """ + + +class AdaptiveProtectionConfig(BaseModel): + layer7DdosDefenseConfig: Optional[Layer7DdosDefenseConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection Layer 7 DDoS Defense. Structure is documented below. + """ + + +class JsonCustomConfig(BaseModel): + contentTypes: Optional[List[str]] = None + """ + A list of custom Content-Type header values to apply the JSON parsing. The + format of the Content-Type header values is defined in + RFC 1341. When configuring a custom Content-Type header + value, only the type/subtype needs to be specified, and the parameters should be excluded. + """ + + +class AdvancedOptionsConfig(BaseModel): + jsonCustomConfig: Optional[JsonCustomConfig] = None + """ + Custom configuration to apply the JSON parsing. Only applicable when + json_parsing is set to STANDARD. Structure is documented below. + """ + jsonParsing: Optional[str] = None + """ + Whether or not to JSON parse the payload body. Defaults to DISABLED. + """ + logLevel: Optional[str] = None + """ + Log level to use. Defaults to NORMAL. + """ + userIpRequestHeaders: Optional[List[str]] = None + """ + An optional list of case-insensitive request header names to use for resolving the callers client IP address. + """ + + +class RecaptchaOptionsConfig(BaseModel): + redirectSiteKey: Optional[str] = None + """ + A field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. + """ + + +class RequestHeadersToAdd(BaseModel): + headerName: Optional[str] = None + """ + The name of the header to set. + """ + headerValue: Optional[str] = None + """ + The value to set the named header to. + """ + + +class HeaderAction(BaseModel): + requestHeadersToAdds: Optional[List[RequestHeadersToAdd]] = None + """ + The list of request headers to add or overwrite if they're already present. Structure is documented below. + """ + + +class Config(BaseModel): + srcIpRanges: Optional[List[str]] = None + """ + Set of IP addresses or ranges (IPV4 or IPV6) in CIDR notation + to match against inbound traffic. There is a limit of 10 IP ranges per rule. A value of * matches all IPs + (can be used to override the default behavior). + """ + + +class Expr(BaseModel): + expression: Optional[str] = None + """ + Textual representation of an expression in Common Expression Language syntax. + The application context of the containing message determines which well-known feature set of CEL is supported. + """ + + +class RecaptchaOptions(BaseModel): + actionTokenSiteKeys: Optional[List[str]] = None + """ + A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + """ + sessionTokenSiteKeys: Optional[List[str]] = None + """ + A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + """ + + +class ExprOptions(BaseModel): + recaptchaOptions: Optional[RecaptchaOptions] = None + """ + reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect. + Structure is documented below. + """ + + +class Match(BaseModel): + config: Optional[Config] = None + """ + The configuration options available when specifying versioned_expr. + This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + Structure is documented below. + """ + expr: Optional[Expr] = None + """ + User defined CEVAL expression. A CEVAL expression is used to specify match criteria + such as origin.ip, source.region_code and contents in the request header. + Structure is documented below. + """ + exprOptions: Optional[ExprOptions] = None + """ + The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr'). + Structure is documented below. + """ + versionedExpr: Optional[str] = None + """ + Predefined rule expression. If this field is specified, config must also be specified. + Available options: + """ + + +class RequestCookieItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestHeaderItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestQueryParamItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestUriItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class ExclusionItem(BaseModel): + requestCookie: Optional[List[RequestCookieItem]] = None + """ + Request cookie whose value will be excluded from inspection during preconfigured WAF evaluation. Structure is documented below. + """ + requestHeader: Optional[List[RequestHeaderItem]] = None + """ + Request header whose value will be excluded from inspection during preconfigured WAF evaluation. Structure is documented below. + """ + requestQueryParam: Optional[List[RequestQueryParamItem]] = None + """ + Request query parameter whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body. Structure is documented below. + """ + requestUri: Optional[List[RequestUriItem]] = None + """ + Request URI from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded. Structure is documented below. + """ + targetRuleIds: Optional[List[str]] = None + """ + A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set. + """ + targetRuleSet: Optional[str] = None + """ + Target WAF rule set to apply the preconfigured WAF exclusion. + """ + + +class PreconfiguredWafConfig(BaseModel): + exclusion: Optional[List[ExclusionItem]] = None + """ + An exclusion to apply during preconfigured WAF evaluation. Structure is documented below. + """ + + +class BanThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class EnforceOnKeyConfig(BaseModel): + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + """ + enforceOnKeyType: Optional[str] = None + """ + Determines the key to enforce the rate_limit_threshold on. If not specified, defaults to ALL. + """ + + +class ExceedRedirectOptions(BaseModel): + target: Optional[str] = None + """ + External redirection target when EXTERNAL_302 is set in type. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class RateLimitThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class RateLimitOptions(BaseModel): + banDurationSec: Optional[float] = None + """ + Can only be specified if the action for the rule is rate_based_ban. + If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + """ + banThreshold: Optional[BanThreshold] = None + """ + Can only be specified if the action for the rule is rate_based_ban. + If specified, the key will be banned for the configured ban_duration_sec when the number of requests that exceed the rate_limit_threshold also + exceed this ban_threshold. Structure is documented below. + """ + conformAction: Optional[str] = None + """ + Action to take for requests that are under the configured rate limit threshold. Valid option is allow only. + """ + enforceOnKey: Optional[str] = None + """ + Determines the key to enforce the rate_limit_threshold on. If not specified, defaults to ALL. + """ + enforceOnKeyConfigs: Optional[List[EnforceOnKeyConfig]] = None + """ + If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which rate limit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must be set to an empty string. Structure is documented below. + """ + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + """ + exceedAction: Optional[str] = None + """ + When a request is denied, returns the HTTP response code specified. + Valid options are deny() where valid values for status are 403, 404, 429, and 502. + """ + exceedRedirectOptions: Optional[ExceedRedirectOptions] = None + """ + Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. Structure is documented below. + """ + rateLimitThreshold: Optional[RateLimitThreshold] = None + """ + Threshold at which to begin ratelimiting. Structure is documented below. + """ + + +class RedirectOptions(BaseModel): + target: Optional[str] = None + """ + External redirection target when EXTERNAL_302 is set in type. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class RuleItem(BaseModel): + action: Optional[str] = None + """ + Action to take when match matches the request. Valid values: + """ + description: Optional[str] = None + """ + An optional description of this rule. Max size is 64. + """ + headerAction: Optional[HeaderAction] = None + """ + Additional actions that are performed on headers. Structure is documented below. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. + If it evaluates to true, the corresponding action is enforced. Structure is documented below. + """ + preconfiguredWafConfig: Optional[PreconfiguredWafConfig] = None + """ + Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. Structure is documented below. + """ + preview: Optional[bool] = None + """ + When set to true, the action specified above is not enforced. + Stackdriver logs for requests that trigger a preview action are annotated as such. + """ + priority: Optional[float] = None + """ + An unique positive integer indicating the priority of evaluation for a rule. + Rules are evaluated from highest priority (lowest numerically) to lowest priority (highest numerically) in order. + """ + rateLimitOptions: Optional[RateLimitOptions] = None + """ + Must be specified if the action is rate_based_ban or throttle. Cannot be specified for other actions. Structure is documented below. + """ + redirectOptions: Optional[RedirectOptions] = None + """ + Can be specified if the action is redirect. Cannot be specified for other actions. Structure is documented below. + """ + + +class ForProvider(BaseModel): + adaptiveProtectionConfig: Optional[AdaptiveProtectionConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[AdvancedOptionsConfig] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[RecaptchaOptionsConfig] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class InitProvider(BaseModel): + adaptiveProtectionConfig: Optional[AdaptiveProtectionConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[AdvancedOptionsConfig] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[RecaptchaOptionsConfig] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + adaptiveProtectionConfig: Optional[AdaptiveProtectionConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[AdvancedOptionsConfig] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/securityPolicies/{{name}} + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[RecaptchaOptionsConfig] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SecurityPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['SecurityPolicy']] = 'SecurityPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SecurityPolicySpec defines the desired state of SecurityPolicy + """ + status: Optional[Status] = None + """ + SecurityPolicyStatus defines the observed state of SecurityPolicy. + """ + + +class SecurityPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SecurityPolicy] + """ + List of securitypolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/serviceattachment/__init__.py b/schemas/python/models/io/upbound/gcp/compute/serviceattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/serviceattachment/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/serviceattachment/v1beta1.py new file mode 100644 index 000000000..858ff26c6 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/serviceattachment/v1beta1.py @@ -0,0 +1,620 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_serviceattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkUrlRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkUrlSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ConsumerAcceptList(BaseModel): + connectionLimit: Optional[float] = None + """ + The number of consumer forwarding rules the consumer project can + create. + """ + networkUrl: Optional[str] = None + """ + The network that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + networkUrlRef: Optional[NetworkUrlRef] = None + """ + Reference to a Network in compute to populate networkUrl. + """ + networkUrlSelector: Optional[NetworkUrlSelector] = None + """ + Selector for a Network in compute to populate networkUrl. + """ + projectIdOrNum: Optional[str] = None + """ + A project that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + + +class NatSubnetsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NatSubnetsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + connectionPreference: Optional[str] = None + """ + The connection preference to use for this service attachment. Valid + values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL". + """ + consumerAcceptLists: Optional[List[ConsumerAcceptList]] = None + """ + An array of projects that are allowed to connect to this service + attachment. + Structure is documented below. + """ + consumerRejectLists: Optional[List[str]] = None + """ + An array of projects that are not allowed to connect to this service + attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + domainNames: Optional[List[str]] = None + """ + If specified, the domain name will be used during the integration between + the PSC connected endpoints and the Cloud DNS. For example, this is a + valid domain name: "p.mycompany.com.". Current max number of domain names + supported is 1. + """ + enableProxyProtocol: Optional[bool] = None + """ + If true, enable the proxy protocol which is for supplying client TCP/IP + address data in TCP connections that traverse proxies on their way to + destination servers. + """ + natSubnets: Optional[List[str]] = None + """ + An array of subnets that is provided for NAT in this service attachment. + """ + natSubnetsRefs: Optional[List[NatSubnetsRef]] = None + """ + References to Subnetwork in compute to populate natSubnets. + """ + natSubnetsSelector: Optional[NatSubnetsSelector] = None + """ + Selector for a list of Subnetwork in compute to populate natSubnets. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + propagatedConnectionLimit: Optional[float] = None + """ + The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. + This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. + If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. + If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. + If unspecified, the default propagated connection limit is 250. To explicitly send a zero value, set send_propagated_connection_limit_if_zero = true. + """ + reconcileConnections: Optional[bool] = None + """ + This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. + If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . + If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. + """ + region: str + """ + URL of the region where the resource resides. + """ + sendPropagatedConnectionLimitIfZero: Optional[bool] = None + """ + Controls the behavior of propagated_connection_limit. + When false, setting propagated_connection_limit to zero causes the provider to use to the API's default value. + When true, the provider will set propagated_connection_limit to zero. + Defaults to false. + """ + targetService: Optional[str] = None + """ + The URL of a service serving the endpoint identified by this service attachment. + """ + targetServiceRef: Optional[TargetServiceRef] = None + """ + Reference to a ForwardingRule in compute to populate targetService. + """ + targetServiceSelector: Optional[TargetServiceSelector] = None + """ + Selector for a ForwardingRule in compute to populate targetService. + """ + + +class InitProvider(BaseModel): + connectionPreference: Optional[str] = None + """ + The connection preference to use for this service attachment. Valid + values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL". + """ + consumerAcceptLists: Optional[List[ConsumerAcceptList]] = None + """ + An array of projects that are allowed to connect to this service + attachment. + Structure is documented below. + """ + consumerRejectLists: Optional[List[str]] = None + """ + An array of projects that are not allowed to connect to this service + attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + domainNames: Optional[List[str]] = None + """ + If specified, the domain name will be used during the integration between + the PSC connected endpoints and the Cloud DNS. For example, this is a + valid domain name: "p.mycompany.com.". Current max number of domain names + supported is 1. + """ + enableProxyProtocol: Optional[bool] = None + """ + If true, enable the proxy protocol which is for supplying client TCP/IP + address data in TCP connections that traverse proxies on their way to + destination servers. + """ + natSubnets: Optional[List[str]] = None + """ + An array of subnets that is provided for NAT in this service attachment. + """ + natSubnetsRefs: Optional[List[NatSubnetsRef]] = None + """ + References to Subnetwork in compute to populate natSubnets. + """ + natSubnetsSelector: Optional[NatSubnetsSelector] = None + """ + Selector for a list of Subnetwork in compute to populate natSubnets. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + propagatedConnectionLimit: Optional[float] = None + """ + The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. + This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. + If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. + If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. + If unspecified, the default propagated connection limit is 250. To explicitly send a zero value, set send_propagated_connection_limit_if_zero = true. + """ + reconcileConnections: Optional[bool] = None + """ + This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. + If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . + If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. + """ + sendPropagatedConnectionLimitIfZero: Optional[bool] = None + """ + Controls the behavior of propagated_connection_limit. + When false, setting propagated_connection_limit to zero causes the provider to use to the API's default value. + When true, the provider will set propagated_connection_limit to zero. + Defaults to false. + """ + targetService: Optional[str] = None + """ + The URL of a service serving the endpoint identified by this service attachment. + """ + targetServiceRef: Optional[TargetServiceRef] = None + """ + Reference to a ForwardingRule in compute to populate targetService. + """ + targetServiceSelector: Optional[TargetServiceSelector] = None + """ + Selector for a ForwardingRule in compute to populate targetService. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ConnectedEndpoint(BaseModel): + consumerNetwork: Optional[str] = None + """ + (Output) + The url of the consumer network. + """ + endpoint: Optional[str] = None + """ + (Output) + The URL of the consumer forwarding rule. + """ + propagatedConnectionCount: Optional[float] = None + """ + (Output) + The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to. + """ + pscConnectionId: Optional[str] = None + """ + (Output) + The PSC connection id of the connected endpoint. + """ + status: Optional[str] = None + """ + (Output) + The status of the connection from the consumer forwarding rule to + this service attachment. + """ + + +class ConsumerAcceptListModel(BaseModel): + connectionLimit: Optional[float] = None + """ + The number of consumer forwarding rules the consumer project can + create. + """ + networkUrl: Optional[str] = None + """ + The network that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + projectIdOrNum: Optional[str] = None + """ + A project that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + + +class AtProvider(BaseModel): + connectedEndpoints: Optional[List[ConnectedEndpoint]] = None + """ + An array of the consumer forwarding rules connected to this service + attachment. + Structure is documented below. + """ + connectionPreference: Optional[str] = None + """ + The connection preference to use for this service attachment. Valid + values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL". + """ + consumerAcceptLists: Optional[List[ConsumerAcceptListModel]] = None + """ + An array of projects that are allowed to connect to this service + attachment. + Structure is documented below. + """ + consumerRejectLists: Optional[List[str]] = None + """ + An array of projects that are not allowed to connect to this service + attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + domainNames: Optional[List[str]] = None + """ + If specified, the domain name will be used during the integration between + the PSC connected endpoints and the Cloud DNS. For example, this is a + valid domain name: "p.mycompany.com.". Current max number of domain names + supported is 1. + """ + enableProxyProtocol: Optional[bool] = None + """ + If true, enable the proxy protocol which is for supplying client TCP/IP + address data in TCP connections that traverse proxies on their way to + destination servers. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. This field is used internally during + updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/serviceAttachments/{{name}} + """ + natSubnets: Optional[List[str]] = None + """ + An array of subnets that is provided for NAT in this service attachment. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + propagatedConnectionLimit: Optional[float] = None + """ + The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. + This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. + If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. + If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. + If unspecified, the default propagated connection limit is 250. To explicitly send a zero value, set send_propagated_connection_limit_if_zero = true. + """ + reconcileConnections: Optional[bool] = None + """ + This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. + If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . + If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. + """ + region: Optional[str] = None + """ + URL of the region where the resource resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sendPropagatedConnectionLimitIfZero: Optional[bool] = None + """ + Controls the behavior of propagated_connection_limit. + When false, setting propagated_connection_limit to zero causes the provider to use to the API's default value. + When true, the provider will set propagated_connection_limit to zero. + Defaults to false. + """ + targetService: Optional[str] = None + """ + The URL of a service serving the endpoint identified by this service attachment. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAttachment']] = 'ServiceAttachment' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAttachmentSpec defines the desired state of ServiceAttachment + """ + status: Optional[Status] = None + """ + ServiceAttachmentStatus defines the observed state of ServiceAttachment. + """ + + +class ServiceAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAttachment] + """ + List of serviceattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/sharedvpchostproject/__init__.py b/schemas/python/models/io/upbound/gcp/compute/sharedvpchostproject/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/sharedvpchostproject/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/sharedvpchostproject/v1beta1.py new file mode 100644 index 000000000..d110549e2 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/sharedvpchostproject/v1beta1.py @@ -0,0 +1,265 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_sharedvpchostproject.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + project: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC host project + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class InitProvider(BaseModel): + project: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC host project + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}} + """ + project: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC host project + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SharedVPCHostProject(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['SharedVPCHostProject']] = 'SharedVPCHostProject' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SharedVPCHostProjectSpec defines the desired state of SharedVPCHostProject + """ + status: Optional[Status] = None + """ + SharedVPCHostProjectStatus defines the observed state of SharedVPCHostProject. + """ + + +class SharedVPCHostProjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SharedVPCHostProject] + """ + List of sharedvpchostprojects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/sharedvpcserviceproject/__init__.py b/schemas/python/models/io/upbound/gcp/compute/sharedvpcserviceproject/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/sharedvpcserviceproject/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/sharedvpcserviceproject/v1beta1.py new file mode 100644 index 000000000..136c1917e --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/sharedvpcserviceproject/v1beta1.py @@ -0,0 +1,332 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_sharedvpcserviceproject.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HostProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HostProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + deletionPolicy: Optional[str] = None + """ + The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON". + """ + hostProject: Optional[str] = None + """ + The ID of a host project to associate. + """ + hostProjectRef: Optional[HostProjectRef] = None + """ + Reference to a Project in cloudplatform to populate hostProject. + """ + hostProjectSelector: Optional[HostProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate hostProject. + """ + serviceProject: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC service project. + """ + serviceProjectRef: Optional[ServiceProjectRef] = None + """ + Reference to a Project in cloudplatform to populate serviceProject. + """ + serviceProjectSelector: Optional[ServiceProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate serviceProject. + """ + + +class InitProvider(BaseModel): + deletionPolicy: Optional[str] = None + """ + The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON". + """ + hostProject: Optional[str] = None + """ + The ID of a host project to associate. + """ + hostProjectRef: Optional[HostProjectRef] = None + """ + Reference to a Project in cloudplatform to populate hostProject. + """ + hostProjectSelector: Optional[HostProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate hostProject. + """ + serviceProject: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC service project. + """ + serviceProjectRef: Optional[ServiceProjectRef] = None + """ + Reference to a Project in cloudplatform to populate serviceProject. + """ + serviceProjectSelector: Optional[ServiceProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate serviceProject. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deletionPolicy: Optional[str] = None + """ + The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON". + """ + hostProject: Optional[str] = None + """ + The ID of a host project to associate. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{host_project}}/{{service_project}} + """ + serviceProject: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC service project. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SharedVPCServiceProject(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['SharedVPCServiceProject']] = 'SharedVPCServiceProject' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SharedVPCServiceProjectSpec defines the desired state of SharedVPCServiceProject + """ + status: Optional[Status] = None + """ + SharedVPCServiceProjectStatus defines the observed state of SharedVPCServiceProject. + """ + + +class SharedVPCServiceProjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SharedVPCServiceProject] + """ + List of sharedvpcserviceprojects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/snapshot/__init__.py b/schemas/python/models/io/upbound/gcp/compute/snapshot/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta1.py new file mode 100644 index 000000000..3facd0a08 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta1.py @@ -0,0 +1,583 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_snapshot.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SnapshotEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an encryption key stored in Google Cloud KMS, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class SourceDiskEncryptionKeyItem(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceDiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceDiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotEncryptionKey: Optional[List[SnapshotEncryptionKeyItem]] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[List[SourceDiskEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class InitProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotEncryptionKey: Optional[List[SnapshotEncryptionKeyItem]] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[List[SourceDiskEncryptionKeyItem]] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SnapshotEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceDiskEncryptionKeyItemModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class AtProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the snapshot, specified in GB. + """ + effectiveLabels: Optional[Dict[str, str]] = None + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/snapshots/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + A list of public visible licenses that apply to this snapshot. This + can be because the original image had licenses attached (such as a + Windows image). snapshotEncryptionKey nested object Encrypts the + snapshot using a customer-supplied encryption key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + snapshotEncryptionKey: Optional[List[SnapshotEncryptionKeyItemModel]] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + snapshotId: Optional[float] = None + """ + The unique identifier for the resource. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[List[SourceDiskEncryptionKeyItemModel]] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + storageBytes: Optional[float] = None + """ + A size of the storage used by the snapshot. As snapshots share + storage, this number is expected to change with snapshot + creation/deletion. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Snapshot(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Snapshot']] = 'Snapshot' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SnapshotSpec defines the desired state of Snapshot + """ + status: Optional[Status] = None + """ + SnapshotStatus defines the observed state of Snapshot. + """ + + +class SnapshotList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Snapshot] + """ + List of snapshots. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta2.py new file mode 100644 index 000000000..d6aed06c0 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/snapshot/v1beta2.py @@ -0,0 +1,572 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_snapshot.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class RawKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class SnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an encryption key stored in Google Cloud KMS, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class SourceDiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an encryption key stored in Google Cloud KMS, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceDiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceDiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotEncryptionKey: Optional[SnapshotEncryptionKey] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class InitProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotEncryptionKey: Optional[SnapshotEncryptionKey] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceDiskEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + + +class AtProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the snapshot, specified in GB. + """ + effectiveLabels: Optional[Dict[str, str]] = None + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/snapshots/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + A list of public visible licenses that apply to this snapshot. This + can be because the original image had licenses attached (such as a + Windows image). snapshotEncryptionKey nested object Encrypts the + snapshot using a customer-supplied encryption key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + snapshotEncryptionKey: Optional[SnapshotEncryptionKeyModel] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + snapshotId: Optional[float] = None + """ + The unique identifier for the resource. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + storageBytes: Optional[float] = None + """ + A size of the storage used by the snapshot. As snapshots share + storage, this number is expected to change with snapshot + creation/deletion. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Snapshot(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Snapshot']] = 'Snapshot' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SnapshotSpec defines the desired state of Snapshot + """ + status: Optional[Status] = None + """ + SnapshotStatus defines the observed state of Snapshot. + """ + + +class SnapshotList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Snapshot] + """ + List of snapshots. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/__init__.py b/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta1.py new file mode 100644 index 000000000..e40368404 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta1.py @@ -0,0 +1,229 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_snapshotiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SnapshotIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['SnapshotIAMMember']] = 'SnapshotIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SnapshotIAMMemberSpec defines the desired state of SnapshotIAMMember + """ + status: Optional[Status] = None + """ + SnapshotIAMMemberStatus defines the observed state of SnapshotIAMMember. + """ + + +class SnapshotIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SnapshotIAMMember] + """ + List of snapshotiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta2.py new file mode 100644 index 000000000..236dac15d --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/snapshotiammember/v1beta2.py @@ -0,0 +1,229 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_snapshotiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SnapshotIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['SnapshotIAMMember']] = 'SnapshotIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SnapshotIAMMemberSpec defines the desired state of SnapshotIAMMember + """ + status: Optional[Status] = None + """ + SnapshotIAMMemberStatus defines the observed state of SnapshotIAMMember. + """ + + +class SnapshotIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SnapshotIAMMember] + """ + List of snapshotiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/sslcertificate/__init__.py b/schemas/python/models/io/upbound/gcp/compute/sslcertificate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/sslcertificate/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/sslcertificate/v1beta1.py new file mode 100644 index 000000000..dfeb9a275 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/sslcertificate/v1beta1.py @@ -0,0 +1,307 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_sslcertificate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CertificateSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class PrivateKeySecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class ForProvider(BaseModel): + certificateSecretRef: Optional[CertificateSecretRef] = None + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: Optional[PrivateKeySecretRef] = None + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + certificateSecretRef: CertificateSecretRef + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: PrivateKeySecretRef + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateId: Optional[float] = None + """ + The unique identifier for the resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + expireTime: Optional[str] = None + """ + Expire time of the certificate in RFC3339 text format. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/sslCertificates/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SSLCertificate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['SSLCertificate']] = 'SSLCertificate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SSLCertificateSpec defines the desired state of SSLCertificate + """ + status: Optional[Status] = None + """ + SSLCertificateStatus defines the observed state of SSLCertificate. + """ + + +class SSLCertificateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SSLCertificate] + """ + List of sslcertificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/sslpolicy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/sslpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/sslpolicy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/sslpolicy/v1beta1.py new file mode 100644 index 000000000..f6819d794 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/sslpolicy/v1beta1.py @@ -0,0 +1,347 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_sslpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + customFeatures: Optional[List[str]] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. This can be one of + COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for which ciphers are available to use. Note: this argument + must be present when using the CUSTOM profile. This argument + must not be present when using any other profile. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + minTlsVersion: Optional[str] = None + """ + The minimum version of SSL protocol that can be used by the clients + to establish a connection with the load balancer. + Default value is TLS_1_0. + Possible values are: TLS_1_0, TLS_1_1, TLS_1_2. + """ + profile: Optional[str] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for information on what cipher suites each profile provides. If + CUSTOM is used, the custom_features attribute must be set. + Default value is COMPATIBLE. + Possible values are: COMPATIBLE, MODERN, RESTRICTED, CUSTOM. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + customFeatures: Optional[List[str]] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. This can be one of + COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for which ciphers are available to use. Note: this argument + must be present when using the CUSTOM profile. This argument + must not be present when using any other profile. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + minTlsVersion: Optional[str] = None + """ + The minimum version of SSL protocol that can be used by the clients + to establish a connection with the load balancer. + Default value is TLS_1_0. + Possible values are: TLS_1_0, TLS_1_1, TLS_1_2. + """ + profile: Optional[str] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for information on what cipher suites each profile provides. If + CUSTOM is used, the custom_features attribute must be set. + Default value is COMPATIBLE. + Possible values are: COMPATIBLE, MODERN, RESTRICTED, CUSTOM. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customFeatures: Optional[List[str]] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. This can be one of + COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for which ciphers are available to use. Note: this argument + must be present when using the CUSTOM profile. This argument + must not be present when using any other profile. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enabledFeatures: Optional[List[str]] = None + """ + The list of features enabled in the SSL policy. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/sslPolicies/{{name}} + """ + minTlsVersion: Optional[str] = None + """ + The minimum version of SSL protocol that can be used by the clients + to establish a connection with the load balancer. + Default value is TLS_1_0. + Possible values are: TLS_1_0, TLS_1_1, TLS_1_2. + """ + profile: Optional[str] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for information on what cipher suites each profile provides. If + CUSTOM is used, the custom_features attribute must be set. + Default value is COMPATIBLE. + Possible values are: COMPATIBLE, MODERN, RESTRICTED, CUSTOM. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SSLPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['SSLPolicy']] = 'SSLPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SSLPolicySpec defines the desired state of SSLPolicy + """ + status: Optional[Status] = None + """ + SSLPolicyStatus defines the observed state of SSLPolicy. + """ + + +class SSLPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SSLPolicy] + """ + List of sslpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/subnetwork/__init__.py b/schemas/python/models/io/upbound/gcp/compute/subnetwork/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta1.py new file mode 100644 index 000000000..7b5a51683 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta1.py @@ -0,0 +1,741 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_subnetwork.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class LogConfigItem(BaseModel): + aggregationInterval: Optional[str] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + Toggles the aggregation interval for collecting flow logs. Increasing the + interval time will reduce the amount of generated flow logs for long + lasting connections. Default is an interval of 5 seconds per connection. + Default value is INTERVAL_5_SEC. + Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN. + """ + filterExpr: Optional[str] = None + """ + Export filter used to define which VPC flow logs should be logged, as as CEL expression. See + https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. + The default value is 'true', which evaluates to include everything. + """ + flowSampling: Optional[float] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + The value of the field must be in [0, 1]. Set the sampling rate of VPC + flow logs within the subnetwork where 1.0 means all collected logs are + reported and 0.0 means no logs are reported. Default is 0.5 which means + half of all collected logs are reported. + """ + metadata: Optional[str] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + Configures whether metadata fields should be added to the reported VPC + flow logs. + Default value is INCLUDE_ALL_METADATA. + Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA. + """ + metadataFields: Optional[List[str]] = None + """ + List of metadata fields that should be added to reported logs. + Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Param(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the subnetwork. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class SecondaryIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The range of IP addresses belonging to this subnetwork secondary + range. Provide this property when you create the subnetwork. + Ranges must be unique and non-overlapping with all primary and + secondary IP ranges within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + rangeName: Optional[str] = None + """ + The name associated with this subnetwork secondary range, used + when adding an alias IP range to a VM instance. The name must + be 1-63 characters long, and comply with RFC1035. The name + must be unique within the subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE_RFC_1918, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE_RFC_1918. + """ + region: str + """ + The GCP region for this subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list + of zero objects you must use the following syntax: + example=[] + For more details about this behavior, see this section. + Structure is documented below. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE_RFC_1918, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE_RFC_1918. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list + of zero objects you must use the following syntax: + example=[] + For more details about this behavior, see this section. + Structure is documented below. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + fingerprint: Optional[str] = None + gatewayAddress: Optional[str] = None + """ + The gateway address for default routes to reach destination addresses + outside this subnetwork. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/subnetworks/{{name}} + """ + internalIpv6Prefix: Optional[str] = None + """ + The internal IPv6 address range that is assigned to this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + ipv6CidrRange: Optional[str] = None + """ + The range of internal IPv6 addresses that are owned by this subnetwork. + """ + ipv6GceEndpoint: Optional[str] = None + """ + Possible endpoints of this subnetwork. It can be one of the following: + """ + logConfig: Optional[List[LogConfigItem]] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + params: Optional[List[Param]] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE_RFC_1918, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE_RFC_1918. + """ + region: Optional[str] = None + """ + The GCP region for this subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list + of zero objects you must use the following syntax: + example=[] + For more details about this behavior, see this section. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6. + """ + state: Optional[str] = None + """ + 'The state of the subnetwork, which can be one of the following values: + READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose + set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. + A subnetwork that is draining cannot be used or modified until it reaches a status of READY' + """ + subnetworkId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Subnetwork(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Subnetwork']] = 'Subnetwork' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SubnetworkSpec defines the desired state of Subnetwork + """ + status: Optional[Status] = None + """ + SubnetworkStatus defines the observed state of Subnetwork. + """ + + +class SubnetworkList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Subnetwork] + """ + List of subnetworks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta2.py new file mode 100644 index 000000000..e9afaa7ee --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/subnetwork/v1beta2.py @@ -0,0 +1,741 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_subnetwork.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class LogConfig(BaseModel): + aggregationInterval: Optional[str] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + Toggles the aggregation interval for collecting flow logs. Increasing the + interval time will reduce the amount of generated flow logs for long + lasting connections. Default is an interval of 5 seconds per connection. + Default value is INTERVAL_5_SEC. + Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN. + """ + filterExpr: Optional[str] = None + """ + Export filter used to define which VPC flow logs should be logged, as as CEL expression. See + https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. + The default value is 'true', which evaluates to include everything. + """ + flowSampling: Optional[float] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + The value of the field must be in [0, 1]. Set the sampling rate of VPC + flow logs within the subnetwork where 1.0 means all collected logs are + reported and 0.0 means no logs are reported. Default is 0.5 which means + half of all collected logs are reported. + """ + metadata: Optional[str] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + Configures whether metadata fields should be added to the reported VPC + flow logs. + Default value is INCLUDE_ALL_METADATA. + Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA. + """ + metadataFields: Optional[List[str]] = None + """ + List of metadata fields that should be added to reported logs. + Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the subnetwork. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class SecondaryIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The range of IP addresses belonging to this subnetwork secondary + range. Provide this property when you create the subnetwork. + Ranges must be unique and non-overlapping with all primary and + secondary IP ranges within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + rangeName: Optional[str] = None + """ + The name associated with this subnetwork secondary range, used + when adding an alias IP range to a VM instance. The name must + be 1-63 characters long, and comply with RFC1035. The name + must be unique within the subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, PEER_MIGRATION or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PEER_MIGRATION is a user created subnetwork that is reserved for migrating resources from one peered network to another. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE. + """ + region: str + """ + The GCP region for this subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list of zero objects, + set send_secondary_ip_range_if_empty = true + Structure is documented below. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, PEER_MIGRATION or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PEER_MIGRATION is a user created subnetwork that is reserved for migrating resources from one peered network to another. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list of zero objects, + set send_secondary_ip_range_if_empty = true + Structure is documented below. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + fingerprint: Optional[str] = None + gatewayAddress: Optional[str] = None + """ + The gateway address for default routes to reach destination addresses + outside this subnetwork. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/subnetworks/{{name}} + """ + internalIpv6Prefix: Optional[str] = None + """ + The internal IPv6 address range that is assigned to this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + ipv6CidrRange: Optional[str] = None + """ + The range of internal IPv6 addresses that are owned by this subnetwork. + """ + ipv6GceEndpoint: Optional[str] = None + """ + Possible endpoints of this subnetwork. It can be one of the following: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, PEER_MIGRATION or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PEER_MIGRATION is a user created subnetwork that is reserved for migrating resources from one peered network to another. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE. + """ + region: Optional[str] = None + """ + The GCP region for this subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list of zero objects, + set send_secondary_ip_range_if_empty = true + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + state: Optional[str] = None + """ + 'The state of the subnetwork, which can be one of the following values: + READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose + set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. + A subnetwork that is draining cannot be used or modified until it reaches a status of READY' + """ + subnetworkId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Subnetwork(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Subnetwork']] = 'Subnetwork' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SubnetworkSpec defines the desired state of Subnetwork + """ + status: Optional[Status] = None + """ + SubnetworkStatus defines the observed state of Subnetwork. + """ + + +class SubnetworkList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Subnetwork] + """ + List of subnetworks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/__init__.py b/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta1.py new file mode 100644 index 000000000..5baee5b4c --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta1.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_subnetworkiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ConditionItem(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[List[ConditionItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SubnetworkIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['SubnetworkIAMMember']] = 'SubnetworkIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SubnetworkIAMMemberSpec defines the desired state of SubnetworkIAMMember + """ + status: Optional[Status] = None + """ + SubnetworkIAMMemberStatus defines the observed state of SubnetworkIAMMember. + """ + + +class SubnetworkIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SubnetworkIAMMember] + """ + List of subnetworkiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta2.py new file mode 100644 index 000000000..51c203f1c --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/subnetworkiammember/v1beta2.py @@ -0,0 +1,275 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_subnetworkiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SubnetworkIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['SubnetworkIAMMember']] = 'SubnetworkIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SubnetworkIAMMemberSpec defines the desired state of SubnetworkIAMMember + """ + status: Optional[Status] = None + """ + SubnetworkIAMMemberStatus defines the observed state of SubnetworkIAMMember. + """ + + +class SubnetworkIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SubnetworkIAMMember] + """ + List of subnetworkiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/targetgrpcproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/targetgrpcproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/targetgrpcproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/targetgrpcproxy/v1beta1.py new file mode 100644 index 000000000..9586c3366 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/targetgrpcproxy/v1beta1.py @@ -0,0 +1,359 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_targetgrpcproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + urlMap: Optional[str] = None + """ + URL to the UrlMap resource that defines the mapping from URL to + the BackendService. The protocol field in the BackendService + must be set to GRPC. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + validateForProxyless: Optional[bool] = None + """ + If true, indicates that the BackendServices referenced by + the urlMap may be accessed by gRPC applications without using + a sidecar proxy. This will enable configuration checks on urlMap + and its referenced BackendServices to not allow unsupported features. + A gRPC application must use "xds:///" scheme in the target URI + of the service it is connecting to. If false, indicates that the + BackendServices referenced by the urlMap will be accessed by gRPC + applications via a sidecar proxy. In this case, a gRPC application + must not use "xds:///" scheme in the target URI of the service + it is connecting to + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + urlMap: Optional[str] = None + """ + URL to the UrlMap resource that defines the mapping from URL to + the BackendService. The protocol field in the BackendService + must be set to GRPC. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + validateForProxyless: Optional[bool] = None + """ + If true, indicates that the BackendServices referenced by + the urlMap may be accessed by gRPC applications without using + a sidecar proxy. This will enable configuration checks on urlMap + and its referenced BackendServices to not allow unsupported features. + A gRPC application must use "xds:///" scheme in the target URI + of the service it is connecting to. If false, indicates that the + BackendServices referenced by the urlMap will be accessed by gRPC + applications via a sidecar proxy. In this case, a gRPC application + must not use "xds:///" scheme in the target URI of the service + it is connecting to + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in + this object. This field is used in optimistic locking. This field + will be ignored when inserting a TargetGrpcProxy. An up-to-date + fingerprint must be provided in order to patch/update the + TargetGrpcProxy; otherwise, the request will fail with error + 412 conditionNotMet. To see the latest fingerprint, make a get() + request to retrieve the TargetGrpcProxy. A base64-encoded string. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetGrpcProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL with id for the resource. + """ + urlMap: Optional[str] = None + """ + URL to the UrlMap resource that defines the mapping from URL to + the BackendService. The protocol field in the BackendService + must be set to GRPC. + """ + validateForProxyless: Optional[bool] = None + """ + If true, indicates that the BackendServices referenced by + the urlMap may be accessed by gRPC applications without using + a sidecar proxy. This will enable configuration checks on urlMap + and its referenced BackendServices to not allow unsupported features. + A gRPC application must use "xds:///" scheme in the target URI + of the service it is connecting to. If false, indicates that the + BackendServices referenced by the urlMap will be accessed by gRPC + applications via a sidecar proxy. In this case, a gRPC application + must not use "xds:///" scheme in the target URI of the service + it is connecting to + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetGRPCProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetGRPCProxy']] = 'TargetGRPCProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetGRPCProxySpec defines the desired state of TargetGRPCProxy + """ + status: Optional[Status] = None + """ + TargetGRPCProxyStatus defines the observed state of TargetGRPCProxy. + """ + + +class TargetGRPCProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetGRPCProxy] + """ + List of targetgrpcproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/targethttpproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/targethttpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/targethttpproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/targethttpproxy/v1beta1.py new file mode 100644 index 000000000..47005c4e7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/targethttpproxy/v1beta1.py @@ -0,0 +1,366 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_targethttpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. + This field will be ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be provided in order to + patch/update the TargetHttpProxy; otherwise, the request will fail with error 412 conditionNotMet. + To see the latest fingerprint, make a get() request to retrieve the TargetHttpProxy. + A base64-encoded string. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetHttpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetHTTPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetHTTPProxy']] = 'TargetHTTPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetHTTPProxySpec defines the desired state of TargetHTTPProxy + """ + status: Optional[Status] = None + """ + TargetHTTPProxyStatus defines the observed state of TargetHTTPProxy. + """ + + +class TargetHTTPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetHTTPProxy] + """ + List of targethttpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/targethttpsproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/targethttpsproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/targethttpsproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/targethttpsproxy/v1beta1.py new file mode 100644 index 000000000..35e48e6e7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/targethttpsproxy/v1beta1.py @@ -0,0 +1,589 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_targethttpsproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SslCertificatesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SslCertificatesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + Certificate manager certificates only apply when the load balancing scheme is set to INTERNAL_MANAGED. + For EXTERNAL and EXTERNAL_MANAGED, use certificate_map instead. + sslCertificates and certificateManagerCertificates fields can not be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field is only supported for EXTERNAL and EXTERNAL_MANAGED load balancing schemes. + For INTERNAL_MANAGED, use certificate_manager_certificates instead. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + quicOverride: Optional[str] = None + """ + Specifies the QUIC override policy for this resource. This determines + whether the load balancer will attempt to negotiate QUIC with clients + or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is + specified, Google manages whether QUIC is used. + Default value is NONE. + Possible values are: NONE, ENABLE, DISABLE. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + sslCertificates and certificateManagerCertificates can not be defined together. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + tlsEarlyData: Optional[str] = None + """ + Specifies whether TLS 1.3 0-RTT Data (“Early Data”) should be accepted for this service. + Early Data allows a TLS resumption handshake to include the initial application payload + (a HTTP request) alongside the handshake, reducing the effective round trips to “zero”. + This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). + Possible values are: STRICT, PERMISSIVE, UNRESTRICTED, DISABLED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + Certificate manager certificates only apply when the load balancing scheme is set to INTERNAL_MANAGED. + For EXTERNAL and EXTERNAL_MANAGED, use certificate_map instead. + sslCertificates and certificateManagerCertificates fields can not be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field is only supported for EXTERNAL and EXTERNAL_MANAGED load balancing schemes. + For INTERNAL_MANAGED, use certificate_manager_certificates instead. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + quicOverride: Optional[str] = None + """ + Specifies the QUIC override policy for this resource. This determines + whether the load balancer will attempt to negotiate QUIC with clients + or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is + specified, Google manages whether QUIC is used. + Default value is NONE. + Possible values are: NONE, ENABLE, DISABLE. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + sslCertificates and certificateManagerCertificates can not be defined together. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + tlsEarlyData: Optional[str] = None + """ + Specifies whether TLS 1.3 0-RTT Data (“Early Data”) should be accepted for this service. + Early Data allows a TLS resumption handshake to include the initial application payload + (a HTTP request) alongside the handshake, reducing the effective round trips to “zero”. + This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). + Possible values are: STRICT, PERMISSIVE, UNRESTRICTED, DISABLED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + Certificate manager certificates only apply when the load balancing scheme is set to INTERNAL_MANAGED. + For EXTERNAL and EXTERNAL_MANAGED, use certificate_map instead. + sslCertificates and certificateManagerCertificates fields can not be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field is only supported for EXTERNAL and EXTERNAL_MANAGED load balancing schemes. + For INTERNAL_MANAGED, use certificate_manager_certificates instead. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. + This field will be ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be provided in order to + patch the TargetHttpsProxy; otherwise, the request will fail with error 412 conditionNotMet. + To see the latest fingerprint, make a get() request to retrieve the TargetHttpsProxy. + A base64-encoded string. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetHttpsProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + quicOverride: Optional[str] = None + """ + Specifies the QUIC override policy for this resource. This determines + whether the load balancer will attempt to negotiate QUIC with clients + or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is + specified, Google manages whether QUIC is used. + Default value is NONE. + Possible values are: NONE, ENABLE, DISABLE. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + sslCertificates and certificateManagerCertificates can not be defined together. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + tlsEarlyData: Optional[str] = None + """ + Specifies whether TLS 1.3 0-RTT Data (“Early Data”) should be accepted for this service. + Early Data allows a TLS resumption handshake to include the initial application payload + (a HTTP request) alongside the handshake, reducing the effective round trips to “zero”. + This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). + Possible values are: STRICT, PERMISSIVE, UNRESTRICTED, DISABLED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetHTTPSProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetHTTPSProxy']] = 'TargetHTTPSProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetHTTPSProxySpec defines the desired state of TargetHTTPSProxy + """ + status: Optional[Status] = None + """ + TargetHTTPSProxyStatus defines the observed state of TargetHTTPSProxy. + """ + + +class TargetHTTPSProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetHTTPSProxy] + """ + List of targethttpsproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/targetinstance/__init__.py b/schemas/python/models/io/upbound/gcp/compute/targetinstance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/targetinstance/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/targetinstance/v1beta1.py new file mode 100644 index 000000000..95019c6d7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/targetinstance/v1beta1.py @@ -0,0 +1,344 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_targetinstance.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + instance: Optional[str] = None + """ + The Compute instance VM handling traffic for this target instance. + Accepts the instance self-link, relative path + (e.g. projects/project/zones/zone/instances/instance) or name. If + name is given, the zone will default to the given zone or + the provider-default zone and the project will default to the + provider-level project. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + natPolicy: Optional[str] = None + """ + NAT option controlling how IPs are NAT'ed to the instance. + Currently only NO_NAT (default value) is supported. + Default value is NO_NAT. + Possible values are: NO_NAT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: str + """ + URL of the zone where the target instance resides. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + instance: Optional[str] = None + """ + The Compute instance VM handling traffic for this target instance. + Accepts the instance self-link, relative path + (e.g. projects/project/zones/zone/instances/instance) or name. If + name is given, the zone will default to the given zone or + the provider-default zone and the project will default to the + provider-level project. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + natPolicy: Optional[str] = None + """ + NAT option controlling how IPs are NAT'ed to the instance. + Currently only NO_NAT (default value) is supported. + Default value is NO_NAT. + Possible values are: NO_NAT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/targetInstances/{{name}} + """ + instance: Optional[str] = None + """ + The Compute instance VM handling traffic for this target instance. + Accepts the instance self-link, relative path + (e.g. projects/project/zones/zone/instances/instance) or name. If + name is given, the zone will default to the given zone or + the provider-default zone and the project will default to the + provider-level project. + """ + natPolicy: Optional[str] = None + """ + NAT option controlling how IPs are NAT'ed to the instance. + Currently only NO_NAT (default value) is supported. + Default value is NO_NAT. + Possible values are: NO_NAT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + zone: Optional[str] = None + """ + URL of the zone where the target instance resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetInstance(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetInstance']] = 'TargetInstance' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetInstanceSpec defines the desired state of TargetInstance + """ + status: Optional[Status] = None + """ + TargetInstanceStatus defines the observed state of TargetInstance. + """ + + +class TargetInstanceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetInstance] + """ + List of targetinstances. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/targetpool/__init__.py b/schemas/python/models/io/upbound/gcp/compute/targetpool/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/targetpool/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/targetpool/v1beta1.py new file mode 100644 index 000000000..ec89ff284 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/targetpool/v1beta1.py @@ -0,0 +1,372 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_targetpool.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backupPool: Optional[str] = None + """ + URL to the backup target pool. Must also set + failover_ratio. + """ + description: Optional[str] = None + """ + Textual description field. + """ + failoverRatio: Optional[float] = None + """ + Ratio (0 to 1) of failed nodes before using the + backup pool (which must also be set). + """ + healthChecks: Optional[List[str]] = None + """ + List of zero or one health check name or self_link. Only + legacy google_compute_http_health_check is supported. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HTTPHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HTTPHealthCheck in compute to populate healthChecks. + """ + instances: Optional[List[str]] = None + """ + List of instances in the pool. They can be given as + URLs, or in the form of "zone/name". + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: str + """ + Where the target pool resides. Defaults to project + region. + """ + sessionAffinity: Optional[str] = None + """ + How to distribute load. Options are "NONE" (no + affinity). "CLIENT_IP" (hash of the source/dest addresses / ports), and + "CLIENT_IP_PROTO" also includes the protocol (default "NONE"). + """ + + +class InitProvider(BaseModel): + backupPool: Optional[str] = None + """ + URL to the backup target pool. Must also set + failover_ratio. + """ + description: Optional[str] = None + """ + Textual description field. + """ + failoverRatio: Optional[float] = None + """ + Ratio (0 to 1) of failed nodes before using the + backup pool (which must also be set). + """ + healthChecks: Optional[List[str]] = None + """ + List of zero or one health check name or self_link. Only + legacy google_compute_http_health_check is supported. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HTTPHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HTTPHealthCheck in compute to populate healthChecks. + """ + instances: Optional[List[str]] = None + """ + List of instances in the pool. They can be given as + URLs, or in the form of "zone/name". + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + sessionAffinity: Optional[str] = None + """ + How to distribute load. Options are "NONE" (no + affinity). "CLIENT_IP" (hash of the source/dest addresses / ports), and + "CLIENT_IP_PROTO" also includes the protocol (default "NONE"). + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backupPool: Optional[str] = None + """ + URL to the backup target pool. Must also set + failover_ratio. + """ + description: Optional[str] = None + """ + Textual description field. + """ + failoverRatio: Optional[float] = None + """ + Ratio (0 to 1) of failed nodes before using the + backup pool (which must also be set). + """ + healthChecks: Optional[List[str]] = None + """ + List of zero or one health check name or self_link. Only + legacy google_compute_http_health_check is supported. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetPools/{{name}} + """ + instances: Optional[List[str]] = None + """ + List of instances in the pool. They can be given as + URLs, or in the form of "zone/name". + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Where the target pool resides. Defaults to project + region. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sessionAffinity: Optional[str] = None + """ + How to distribute load. Options are "NONE" (no + affinity). "CLIENT_IP" (hash of the source/dest addresses / ports), and + "CLIENT_IP_PROTO" also includes the protocol (default "NONE"). + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetPool(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetPool']] = 'TargetPool' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetPoolSpec defines the desired state of TargetPool + """ + status: Optional[Status] = None + """ + TargetPoolStatus defines the observed state of TargetPool. + """ + + +class TargetPoolList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetPool] + """ + List of targetpools. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/targetsslproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/targetsslproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/targetsslproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/targetsslproxy/v1beta1.py new file mode 100644 index 000000000..5cd1cdeb1 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/targetsslproxy/v1beta1.py @@ -0,0 +1,422 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_targetsslproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SslCertificatesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SslCertificatesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field can only be set for global target proxies. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + sslCertificates: Optional[List[str]] = None + """ + A list of SslCertificate resources that are used to authenticate + connections between users and the load balancer. At least one + SSL certificate must be specified. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetSslProxy resource. If not set, the TargetSslProxy + resource will not have any SSL policy configured. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field can only be set for global target proxies. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + sslCertificates: Optional[List[str]] = None + """ + A list of SslCertificate resources that are used to authenticate + connections between users and the load balancer. At least one + SSL certificate must be specified. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetSslProxy resource. If not set, the TargetSslProxy + resource will not have any SSL policy configured. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field can only be set for global target proxies. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetSslProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sslCertificates: Optional[List[str]] = None + """ + A list of SslCertificate resources that are used to authenticate + connections between users and the load balancer. At least one + SSL certificate must be specified. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetSslProxy resource. If not set, the TargetSslProxy + resource will not have any SSL policy configured. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetSSLProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetSSLProxy']] = 'TargetSSLProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetSSLProxySpec defines the desired state of TargetSSLProxy + """ + status: Optional[Status] = None + """ + TargetSSLProxyStatus defines the observed state of TargetSSLProxy. + """ + + +class TargetSSLProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetSSLProxy] + """ + List of targetsslproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/targettcpproxy/__init__.py b/schemas/python/models/io/upbound/gcp/compute/targettcpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/targettcpproxy/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/targettcpproxy/v1beta1.py new file mode 100644 index 000000000..9fac82c9b --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/targettcpproxy/v1beta1.py @@ -0,0 +1,340 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_targettcpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetTcpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetTCPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetTCPProxy']] = 'TargetTCPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetTCPProxySpec defines the desired state of TargetTCPProxy + """ + status: Optional[Status] = None + """ + TargetTCPProxyStatus defines the observed state of TargetTCPProxy. + """ + + +class TargetTCPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetTCPProxy] + """ + List of targettcpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/urlmap/__init__.py b/schemas/python/models/io/upbound/gcp/compute/urlmap/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta1.py new file mode 100644 index 000000000..f7b56d687 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta1.py @@ -0,0 +1,2677 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_urlmap.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ErrorResponseRuleItem(BaseModel): + matchResponseCodes: Optional[List[str]] = None + """ + Valid values include: + """ + overrideResponseCode: Optional[float] = None + """ + The HTTP status code returned with the response containing the custom error content. + If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ErrorServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ErrorServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultCustomErrorResponsePolicyItem(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class CorsPolicyItem(BaseModel): + allowCredentials: Optional[bool] = None + """ + In response to a preflight request, setting this to true indicates that the + actual request can include user credentials. This translates to the Access- + Control-Allow-Credentials header. Defaults to false. + """ + allowHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Headers header. + """ + allowMethods: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Methods header. + """ + allowOriginRegexes: Optional[List[str]] = None + """ + Specifies the regular expression patterns that match allowed origins. For + regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + An origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + allowOrigins: Optional[List[str]] = None + """ + Specifies the list of origins that will be allowed to do CORS requests. An + origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + disabled: Optional[bool] = None + """ + If true, specifies the CORS policy is disabled. + """ + exposeHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Expose-Headers header. + """ + maxAge: Optional[float] = None + """ + Specifies how long the results of a preflight request can be cached. This + translates to the content for the Access-Control-Max-Age header. + """ + + +class AbortItem(BaseModel): + httpStatus: Optional[float] = None + """ + The HTTP status code used to abort the request. The value must be between 200 + and 599 inclusive. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FixedDelayItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class DelayItem(BaseModel): + fixedDelay: Optional[List[FixedDelayItem]] = None + """ + Specifies the value of the fixed delay interval. + Structure is documented below. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FaultInjectionPolicyItem(BaseModel): + abort: Optional[List[AbortItem]] = None + """ + The specification for how client requests are aborted as part of fault + injection. + Structure is documented below. + """ + delay: Optional[List[DelayItem]] = None + """ + The specification for how client requests are delayed as part of fault + injection, before being sent to a backend service. + Structure is documented below. + """ + + +class MaxStreamDurationItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RequestMirrorPolicyItem(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + + +class PerTryTimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class RetryPolicyItem(BaseModel): + numRetries: Optional[float] = None + """ + Specifies the allowed number retries. This number must be > 0. + """ + perTryTimeout: Optional[List[PerTryTimeoutItem]] = None + """ + Specifies a non-zero timeout per retry attempt. + Structure is documented below. + """ + retryConditions: Optional[List[str]] = None + """ + Specifies one or more conditions when this retry rule applies. Valid values are: + """ + + +class TimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewriteItem(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class ResponseHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class HeaderActionItem(BaseModel): + requestHeadersToAdd: Optional[List[RequestHeadersToAddItem]] = None + """ + Headers to add to a matching request prior to forwarding the request to the + backendService. + Structure is documented below. + """ + requestHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the request + prior to forwarding the request to the backendService. + """ + responseHeadersToAdd: Optional[List[ResponseHeadersToAddItem]] = None + """ + Headers to add the response prior to sending the response back to the client. + Structure is documented below. + """ + responseHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the response + prior to sending the response back to the client. + """ + + +class WeightedBackendService(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteActionItem(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItem]] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItem]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DefaultServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultUrlRedirectItem(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class HostRuleItem(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + hosts: Optional[List[str]] = None + """ + The list of host patterns to match. They must be valid hostnames, except * will + match any string of ([a-z0-9-.]*). In that case, * must be the first character + and must be followed in the pattern by either - or .. + """ + pathMatcher: Optional[str] = None + """ + The name of the PathMatcher to use to match the path portion of the URL if the + hostRule matches the URL's host portion. + """ + + +class DefaultRouteActionItemModel(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItem]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItem]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class CustomErrorResponsePolicyItem(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class WeightedBackendServiceModel(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteActionItem(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItem]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItem]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlRedirectItem(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class PathRuleItem(BaseModel): + customErrorResponsePolicy: Optional[List[CustomErrorResponsePolicyItem]] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendBucket in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate service. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class CustomErrorResponsePolicyItemModel(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class RangeMatchItem(BaseModel): + rangeEnd: Optional[float] = None + """ + The end of the range (exclusive). + """ + rangeStart: Optional[float] = None + """ + The start of the range (inclusive). + """ + + +class HeaderMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + headerName: Optional[str] = None + """ + The name of the header. + """ + invertMatch: Optional[bool] = None + """ + If set to false, the headerMatch is considered a match if the match criteria + above are met. If set to true, the headerMatch is considered a match if the + match criteria above are NOT met. Defaults to false. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + rangeMatch: Optional[List[RangeMatchItem]] = None + """ + The header value must be an integer and its value must be in the range specified + in rangeMatch. If the header does not contain an integer, number or is empty, + the match fails. For example for a range [-5, 0] - -3 will match. - 0 will + not match. - 0.25 will not match. - -3someString will not match. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + suffixMatch: Optional[str] = None + """ + The value of the header must end with the contents of suffixMatch. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + Header value. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the provided metadata + based on filterMatchCriteria This list must not be empty and can have at the + most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of filterLabels + contribute towards the overall metadataFilter match. Supported values are: + """ + + +class QueryParameterMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class MatchRule(BaseModel): + fullPathMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request must exactly + match the value specified in fullPathMatch after removing any query parameters + and anchor that may be part of the original URL. FullPathMatch must be between 1 + and 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must + be specified. + """ + headerMatches: Optional[List[HeaderMatch]] = None + """ + Specifies a list of header match criteria, all of which must match corresponding + headers in the request. + Structure is documented below. + """ + ignoreCase: Optional[bool] = None + """ + Specifies that prefixMatch and fullPathMatch matches are case sensitive. + Defaults to false. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing configuration to + a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS + clients present node metadata. If a match takes place, the relevant routing + configuration is made available to those proxies. For each metadataFilter in + this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the + filterLabels must match the corresponding label provided in the metadata. If its + filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match + with corresponding labels in the provided metadata. metadataFilters specified + here can be overrides those specified in ForwardingRule that refers to this + UrlMap. metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + pathTemplateMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request + must match the wildcard pattern specified in pathTemplateMatch + after removing any query parameters and anchor that may be part + of the original URL. + pathTemplateMatch must be between 1 and 255 characters + (inclusive). The pattern specified by pathTemplateMatch may + have at most 5 wildcard operators and at most 5 variable + captures in total. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + queryParameterMatches: Optional[List[QueryParameterMatch]] = None + """ + Specifies a list of query parameter match criteria, all of which must match + corresponding query parameters in the request. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class RequestMirrorPolicyItemModel(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteItemModel(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel1(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteRule(BaseModel): + customErrorResponsePolicy: Optional[List[CustomErrorResponsePolicyItemModel]] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendService in compute to populate service. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItem(BaseModel): + defaultCustomErrorResponsePolicy: Optional[ + List[DefaultCustomErrorResponsePolicyItem] + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[List[DefaultRouteActionItemModel]] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given paths match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. HeaderAction specified here are applied after the + matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + Structure is documented below. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItem]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRule]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class Header(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + Header value. + """ + + +class TestItem(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + expectedOutputUrl: Optional[str] = None + """ + The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. + For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. + For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies httpsRedirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies stripQuery, the test passes only if expectedOutputUrl does not contain any query parameters. + expectedOutputUrl is optional when service is specified. + """ + expectedRedirectResponseCode: Optional[float] = None + """ + For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. + expectedRedirectResponseCode cannot be set when service is set. + """ + headers: Optional[List[Header]] = None + """ + HTTP headers for this request. + Structure is documented below. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendBucket in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate service. + """ + + +class ForProvider(BaseModel): + defaultCustomErrorResponsePolicy: Optional[ + List[DefaultCustomErrorResponsePolicyItem] + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[List[DefaultRouteActionItem]] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItem]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class RequestMirrorPolicyItemModel1(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + + +class UrlRewriteItemModel1(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionItemModel1(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel1]] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel1]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel1(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class DefaultRouteActionItemModel2(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel1]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel1]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel2(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class CustomErrorResponsePolicyItemModel1(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class WeightedBackendServiceModel2(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class CustomErrorResponsePolicyItemModel2(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class RequestMirrorPolicyItemModel2(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteItemModel2(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel3(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class InitProvider(BaseModel): + defaultCustomErrorResponsePolicy: Optional[ + List[DefaultCustomErrorResponsePolicyItem] + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[List[DefaultRouteActionItemModel1]] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel1]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DefaultCustomErrorResponsePolicyItemModel(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class UrlRewriteItemModel3(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionItemModel3(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel2]] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel3]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel3]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel3(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class DefaultRouteActionItemModel4(BaseModel): + corsPolicy: Optional[List[CorsPolicyItem]] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[List[FaultInjectionPolicyItem]] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[List[MaxStreamDurationItem]] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[List[RequestMirrorPolicyItemModel2]] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[List[RetryPolicyItem]] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[List[TimeoutItem]] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[List[UrlRewriteItemModel3]] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel3]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectItemModel4(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class PathRuleItemModel(BaseModel): + customErrorResponsePolicy: Optional[List[CustomErrorResponsePolicyItemModel2]] = ( + None + ) + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class UrlRewriteItemModel4(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class RouteRuleModel(BaseModel): + customErrorResponsePolicy: Optional[List[CustomErrorResponsePolicyItemModel2]] = ( + None + ) + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[List[RouteActionItem]] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + urlRedirect: Optional[List[UrlRedirectItem]] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItemModel(BaseModel): + defaultCustomErrorResponsePolicy: Optional[ + List[DefaultCustomErrorResponsePolicyItemModel] + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[List[DefaultRouteActionItemModel4]] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given paths match. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel4]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. HeaderAction specified here are applied after the + matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + Structure is documented below. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItemModel]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRuleModel]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItemModel(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + expectedOutputUrl: Optional[str] = None + """ + The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. + For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. + For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies httpsRedirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies stripQuery, the test passes only if expectedOutputUrl does not contain any query parameters. + expectedOutputUrl is optional when service is specified. + """ + expectedRedirectResponseCode: Optional[float] = None + """ + For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. + expectedRedirectResponseCode cannot be set when service is set. + """ + headers: Optional[List[Header]] = None + """ + HTTP headers for this request. + Structure is documented below. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + defaultCustomErrorResponsePolicy: Optional[ + List[DefaultCustomErrorResponsePolicyItemModel] + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[List[DefaultRouteActionItemModel3]] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultUrlRedirect: Optional[List[DefaultUrlRedirectItemModel3]] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this object. This + field is used in optimistic locking. + """ + headerAction: Optional[List[HeaderActionItem]] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/urlMaps/{{name}} + """ + mapId: Optional[float] = None + """ + The unique identifier for the resource. + """ + pathMatcher: Optional[List[PathMatcherItemModel]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + test: Optional[List[TestItemModel]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class URLMap(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['URLMap']] = 'URLMap' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + URLMapSpec defines the desired state of URLMap + """ + status: Optional[Status] = None + """ + URLMapStatus defines the observed state of URLMap. + """ + + +class URLMapList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[URLMap] + """ + List of urlmaps. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta2.py b/schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta2.py new file mode 100644 index 000000000..0672d4350 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/urlmap/v1beta2.py @@ -0,0 +1,2667 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta2_urlmap.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ErrorResponseRuleItem(BaseModel): + matchResponseCodes: Optional[List[str]] = None + """ + Valid values include: + """ + overrideResponseCode: Optional[float] = None + """ + The HTTP status code returned with the response containing the custom error content. + If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ErrorServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ErrorServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultCustomErrorResponsePolicy(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class CorsPolicy(BaseModel): + allowCredentials: Optional[bool] = None + """ + In response to a preflight request, setting this to true indicates that the + actual request can include user credentials. This translates to the Access- + Control-Allow-Credentials header. Defaults to false. + """ + allowHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Headers header. + """ + allowMethods: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Methods header. + """ + allowOriginRegexes: Optional[List[str]] = None + """ + Specifies the regular expression patterns that match allowed origins. For + regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + An origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + allowOrigins: Optional[List[str]] = None + """ + Specifies the list of origins that will be allowed to do CORS requests. An + origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + disabled: Optional[bool] = None + """ + If true, specifies the CORS policy is disabled. + """ + exposeHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Expose-Headers header. + """ + maxAge: Optional[float] = None + """ + Specifies how long the results of a preflight request can be cached. This + translates to the content for the Access-Control-Max-Age header. + """ + + +class Abort(BaseModel): + httpStatus: Optional[float] = None + """ + The HTTP status code used to abort the request. The value must be between 200 + and 599 inclusive. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FixedDelay(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class Delay(BaseModel): + fixedDelay: Optional[FixedDelay] = None + """ + Specifies the value of the fixed delay interval. + Structure is documented below. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FaultInjectionPolicy(BaseModel): + abort: Optional[Abort] = None + """ + The specification for how client requests are aborted as part of fault + injection. + Structure is documented below. + """ + delay: Optional[Delay] = None + """ + The specification for how client requests are delayed as part of fault + injection, before being sent to a backend service. + Structure is documented below. + """ + + +class MaxStreamDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RequestMirrorPolicy(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + + +class PerTryTimeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class RetryPolicy(BaseModel): + numRetries: Optional[float] = None + """ + Specifies the allowed number retries. This number must be > 0. + """ + perTryTimeout: Optional[PerTryTimeout] = None + """ + Specifies a non-zero timeout per retry attempt. + Structure is documented below. + """ + retryConditions: Optional[List[str]] = None + """ + Specifies one or more conditions when this retry rule applies. Valid values are: + """ + + +class Timeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewrite(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class ResponseHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class HeaderAction(BaseModel): + requestHeadersToAdd: Optional[List[RequestHeadersToAddItem]] = None + """ + Headers to add to a matching request prior to forwarding the request to the + backendService. + Structure is documented below. + """ + requestHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the request + prior to forwarding the request to the backendService. + """ + responseHeadersToAdd: Optional[List[ResponseHeadersToAddItem]] = None + """ + Headers to add the response prior to sending the response back to the client. + Structure is documented below. + """ + responseHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the response + prior to sending the response back to the client. + """ + + +class WeightedBackendService(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DefaultServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultUrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class HostRuleItem(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + hosts: Optional[List[str]] = None + """ + The list of host patterns to match. They must be valid hostnames, except * will + match any string of ([a-z0-9-.]*). In that case, * must be the first character + and must be followed in the pattern by either - or .. + """ + pathMatcher: Optional[str] = None + """ + The name of the PathMatcher to use to match the path portion of the URL if the + hostRule matches the URL's host portion. + """ + + +class DefaultRouteActionModel(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class CustomErrorResponsePolicy(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class WeightedBackendServiceModel(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class PathRuleItem(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicy] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendBucket in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class CustomErrorResponsePolicyModel(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class RangeMatch(BaseModel): + rangeEnd: Optional[float] = None + """ + The end of the range (exclusive). + """ + rangeStart: Optional[float] = None + """ + The start of the range (inclusive). + """ + + +class HeaderMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + headerName: Optional[str] = None + """ + The name of the header. + """ + invertMatch: Optional[bool] = None + """ + If set to false, the headerMatch is considered a match if the match criteria + above are met. If set to true, the headerMatch is considered a match if the + match criteria above are NOT met. Defaults to false. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + rangeMatch: Optional[RangeMatch] = None + """ + The header value must be an integer and its value must be in the range specified + in rangeMatch. If the header does not contain an integer, number or is empty, + the match fails. For example for a range [-5, 0] - -3 will match. - 0 will + not match. - 0.25 will not match. - -3someString will not match. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + suffixMatch: Optional[str] = None + """ + The value of the header must end with the contents of suffixMatch. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + Header value. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the provided metadata + based on filterMatchCriteria This list must not be empty and can have at the + most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of filterLabels + contribute towards the overall metadataFilter match. Supported values are: + """ + + +class QueryParameterMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class MatchRule(BaseModel): + fullPathMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request must exactly + match the value specified in fullPathMatch after removing any query parameters + and anchor that may be part of the original URL. FullPathMatch must be between 1 + and 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must + be specified. + """ + headerMatches: Optional[List[HeaderMatch]] = None + """ + Specifies a list of header match criteria, all of which must match corresponding + headers in the request. + Structure is documented below. + """ + ignoreCase: Optional[bool] = None + """ + Specifies that prefixMatch and fullPathMatch matches are case sensitive. + Defaults to false. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing configuration to + a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS + clients present node metadata. If a match takes place, the relevant routing + configuration is made available to those proxies. For each metadataFilter in + this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the + filterLabels must match the corresponding label provided in the metadata. If its + filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match + with corresponding labels in the provided metadata. metadataFilters specified + here can be overrides those specified in ForwardingRule that refers to this + UrlMap. metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + pathTemplateMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request + must match the wildcard pattern specified in pathTemplateMatch + after removing any query parameters and anchor that may be part + of the original URL. + pathTemplateMatch must be between 1 and 255 characters + (inclusive). The pattern specified by pathTemplateMatch may + have at most 5 wildcard operators and at most 5 variable + captures in total. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + queryParameterMatches: Optional[List[QueryParameterMatch]] = None + """ + Specifies a list of query parameter match criteria, all of which must match + corresponding query parameters in the request. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class RequestMirrorPolicyModel(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel1(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteRule(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicyModel] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendService in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItem(BaseModel): + defaultCustomErrorResponsePolicy: Optional[DefaultCustomErrorResponsePolicy] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given paths match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. HeaderAction specified here are applied after the + matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + Structure is documented below. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItem]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRule]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class Header(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + Header value. + """ + + +class TestItem(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + expectedOutputUrl: Optional[str] = None + """ + The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. + For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. + For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies httpsRedirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies stripQuery, the test passes only if expectedOutputUrl does not contain any query parameters. + expectedOutputUrl is optional when service is specified. + """ + expectedRedirectResponseCode: Optional[float] = None + """ + For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. + expectedRedirectResponseCode cannot be set when service is set. + """ + headers: Optional[List[Header]] = None + """ + HTTP headers for this request. + Structure is documented below. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendBucket in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate service. + """ + + +class ForProvider(BaseModel): + defaultCustomErrorResponsePolicy: Optional[DefaultCustomErrorResponsePolicy] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteAction] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirect] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class RequestMirrorPolicyModel1(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + + +class UrlRewriteModel1(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionModel1(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel1] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel1(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class DefaultRouteActionModel2(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel1] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel2(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class CustomErrorResponsePolicyModel1(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class WeightedBackendServiceModel2(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class CustomErrorResponsePolicyModel2(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class RequestMirrorPolicyModel2(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel2(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel3(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class InitProvider(BaseModel): + defaultCustomErrorResponsePolicy: Optional[DefaultCustomErrorResponsePolicy] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel1] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel1] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DefaultCustomErrorResponsePolicyModel(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class UrlRewriteModel3(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionModel3(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel3] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel3]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel3(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class DefaultRouteActionModel4(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel3] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel3]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel4(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class PathRuleItemModel(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicyModel2] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class UrlRewriteModel4(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class RouteRuleModel(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicyModel2] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItemModel(BaseModel): + defaultCustomErrorResponsePolicy: Optional[ + DefaultCustomErrorResponsePolicyModel + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel4] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given paths match. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel4] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. HeaderAction specified here are applied after the + matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + Structure is documented below. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItemModel]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRuleModel]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItemModel(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + expectedOutputUrl: Optional[str] = None + """ + The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. + For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. + For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies httpsRedirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies stripQuery, the test passes only if expectedOutputUrl does not contain any query parameters. + expectedOutputUrl is optional when service is specified. + """ + expectedRedirectResponseCode: Optional[float] = None + """ + For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. + expectedRedirectResponseCode cannot be set when service is set. + """ + headers: Optional[List[Header]] = None + """ + HTTP headers for this request. + Structure is documented below. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + defaultCustomErrorResponsePolicy: Optional[ + DefaultCustomErrorResponsePolicyModel + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel3] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel3] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this object. This + field is used in optimistic locking. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/urlMaps/{{name}} + """ + mapId: Optional[float] = None + """ + The unique identifier for the resource. + """ + pathMatcher: Optional[List[PathMatcherItemModel]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + test: Optional[List[TestItemModel]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class URLMap(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta2']] = ( + 'compute.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['URLMap']] = 'URLMap' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + URLMapSpec defines the desired state of URLMap + """ + status: Optional[Status] = None + """ + URLMapStatus defines the observed state of URLMap. + """ + + +class URLMapList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[URLMap] + """ + List of urlmaps. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/vpngateway/__init__.py b/schemas/python/models/io/upbound/gcp/compute/vpngateway/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/vpngateway/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/vpngateway/v1beta1.py new file mode 100644 index 000000000..42a8fdd4f --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/vpngateway/v1beta1.py @@ -0,0 +1,312 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_vpngateway.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The region this gateway should sit in. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + gatewayId: Optional[float] = None + """ + The unique identifier for the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}} + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region this gateway should sit in. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class VPNGateway(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['VPNGateway']] = 'VPNGateway' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + VPNGatewaySpec defines the desired state of VPNGateway + """ + status: Optional[Status] = None + """ + VPNGatewayStatus defines the observed state of VPNGateway. + """ + + +class VPNGatewayList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[VPNGateway] + """ + List of vpngateways. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/compute/vpntunnel/__init__.py b/schemas/python/models/io/upbound/gcp/compute/vpntunnel/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/compute/vpntunnel/v1beta1.py b/schemas/python/models/io/upbound/gcp/compute/vpntunnel/v1beta1.py new file mode 100644 index 000000000..5b9d2b0e7 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/compute/vpntunnel/v1beta1.py @@ -0,0 +1,667 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_upbound_io_v1beta1_vpntunnel.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class PeerExternalGatewayRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeerExternalGatewaySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SharedSecretSecretRef(BaseModel): + key: str + """ + The key to select. + """ + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class TargetVpnGatewayRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetVpnGatewaySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class VpnGatewayRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class VpnGatewaySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + ikeVersion: Optional[float] = None + """ + IKE protocol version to use when establishing the VPN tunnel with + peer VPN gateway. + Acceptable IKE versions are 1 or 2. Default version is 2. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this VpnTunnel. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + localTrafficSelector: Optional[List[str]] = None + """ + Local traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + peerExternalGateway: Optional[str] = None + """ + URL of the peer side external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayInterface: Optional[float] = None + """ + The interface ID of the external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayRef: Optional[PeerExternalGatewayRef] = None + """ + Reference to a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerExternalGatewaySelector: Optional[PeerExternalGatewaySelector] = None + """ + Selector for a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerGcpGateway: Optional[str] = None + """ + URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. + If provided, the VPN tunnel will automatically use the same vpn_gateway_interface + ID in the peer GCP VPN gateway. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + peerIp: Optional[str] = None + """ + IP address of the peer VPN gateway. Only IPv4 is supported. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The region where the tunnel is located. If unset, is set to the region of target_vpn_gateway. + """ + remoteTrafficSelector: Optional[List[str]] = None + """ + Remote traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + router: Optional[str] = None + """ + URL of router resource to be used for dynamic routing. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + sharedSecretSecretRef: Optional[SharedSecretSecretRef] = None + """ + Shared secret used to set the secure session between the Cloud VPN + gateway and the peer VPN gateway. + Note: This property is sensitive and will not be displayed in the plan. + """ + targetVpnGateway: Optional[str] = None + """ + URL of the Target VPN gateway with which this VPN tunnel is + associated. + """ + targetVpnGatewayRef: Optional[TargetVpnGatewayRef] = None + """ + Reference to a VPNGateway in compute to populate targetVpnGateway. + """ + targetVpnGatewaySelector: Optional[TargetVpnGatewaySelector] = None + """ + Selector for a VPNGateway in compute to populate targetVpnGateway. + """ + vpnGateway: Optional[str] = None + """ + URL of the VPN gateway with which this VPN tunnel is associated. + This must be used if a High Availability VPN gateway resource is created. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + vpnGatewayInterface: Optional[float] = None + """ + The interface ID of the VPN gateway with which this VPN tunnel is associated. + """ + vpnGatewayRef: Optional[VpnGatewayRef] = None + """ + Reference to a HaVPNGateway in compute to populate vpnGateway. + """ + vpnGatewaySelector: Optional[VpnGatewaySelector] = None + """ + Selector for a HaVPNGateway in compute to populate vpnGateway. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + ikeVersion: Optional[float] = None + """ + IKE protocol version to use when establishing the VPN tunnel with + peer VPN gateway. + Acceptable IKE versions are 1 or 2. Default version is 2. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this VpnTunnel. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + localTrafficSelector: Optional[List[str]] = None + """ + Local traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + peerExternalGateway: Optional[str] = None + """ + URL of the peer side external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayInterface: Optional[float] = None + """ + The interface ID of the external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayRef: Optional[PeerExternalGatewayRef] = None + """ + Reference to a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerExternalGatewaySelector: Optional[PeerExternalGatewaySelector] = None + """ + Selector for a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerGcpGateway: Optional[str] = None + """ + URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. + If provided, the VPN tunnel will automatically use the same vpn_gateway_interface + ID in the peer GCP VPN gateway. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + peerIp: Optional[str] = None + """ + IP address of the peer VPN gateway. Only IPv4 is supported. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + remoteTrafficSelector: Optional[List[str]] = None + """ + Remote traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + router: Optional[str] = None + """ + URL of router resource to be used for dynamic routing. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + sharedSecretSecretRef: SharedSecretSecretRef + """ + Shared secret used to set the secure session between the Cloud VPN + gateway and the peer VPN gateway. + Note: This property is sensitive and will not be displayed in the plan. + """ + targetVpnGateway: Optional[str] = None + """ + URL of the Target VPN gateway with which this VPN tunnel is + associated. + """ + targetVpnGatewayRef: Optional[TargetVpnGatewayRef] = None + """ + Reference to a VPNGateway in compute to populate targetVpnGateway. + """ + targetVpnGatewaySelector: Optional[TargetVpnGatewaySelector] = None + """ + Selector for a VPNGateway in compute to populate targetVpnGateway. + """ + vpnGateway: Optional[str] = None + """ + URL of the VPN gateway with which this VPN tunnel is associated. + This must be used if a High Availability VPN gateway resource is created. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + vpnGatewayInterface: Optional[float] = None + """ + The interface ID of the VPN gateway with which this VPN tunnel is associated. + """ + vpnGatewayRef: Optional[VpnGatewayRef] = None + """ + Reference to a HaVPNGateway in compute to populate vpnGateway. + """ + vpnGatewaySelector: Optional[VpnGatewaySelector] = None + """ + Selector for a HaVPNGateway in compute to populate vpnGateway. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + detailedStatus: Optional[str] = None + """ + Detailed status message for the VPN tunnel. + """ + effectiveLabels: Optional[Dict[str, str]] = None + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/vpnTunnels/{{name}} + """ + ikeVersion: Optional[float] = None + """ + IKE protocol version to use when establishing the VPN tunnel with + peer VPN gateway. + Acceptable IKE versions are 1 or 2. Default version is 2. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this VpnTunnel. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + localTrafficSelector: Optional[List[str]] = None + """ + Local traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + peerExternalGateway: Optional[str] = None + """ + URL of the peer side external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayInterface: Optional[float] = None + """ + The interface ID of the external VPN gateway to which this VPN tunnel is connected. + """ + peerGcpGateway: Optional[str] = None + """ + URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. + If provided, the VPN tunnel will automatically use the same vpn_gateway_interface + ID in the peer GCP VPN gateway. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + peerIp: Optional[str] = None + """ + IP address of the peer VPN gateway. Only IPv4 is supported. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the tunnel is located. If unset, is set to the region of target_vpn_gateway. + """ + remoteTrafficSelector: Optional[List[str]] = None + """ + Remote traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + router: Optional[str] = None + """ + URL of router resource to be used for dynamic routing. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sharedSecretHash: Optional[str] = None + """ + Hash of the shared secret. + """ + targetVpnGateway: Optional[str] = None + """ + URL of the Target VPN gateway with which this VPN tunnel is + associated. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + tunnelId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + vpnGateway: Optional[str] = None + """ + URL of the VPN gateway with which this VPN tunnel is associated. + This must be used if a High Availability VPN gateway resource is created. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + vpnGatewayInterface: Optional[float] = None + """ + The interface ID of the VPN gateway with which this VPN tunnel is associated. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class VPNTunnel(BaseModel): + apiVersion: Optional[Literal['compute.gcp.upbound.io/v1beta1']] = ( + 'compute.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['VPNTunnel']] = 'VPNTunnel' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + VPNTunnelSpec defines the desired state of VPNTunnel + """ + status: Optional[Status] = None + """ + VPNTunnelStatus defines the observed state of VPNTunnel. + """ + + +class VPNTunnelList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[VPNTunnel] + """ + List of vpntunnels. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/container/__init__.py b/schemas/python/models/io/upbound/gcp/container/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/container/cluster/__init__.py b/schemas/python/models/io/upbound/gcp/container/cluster/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/container/cluster/v1beta1.py b/schemas/python/models/io/upbound/gcp/container/cluster/v1beta1.py new file mode 100644 index 000000000..36d625afb --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/container/cluster/v1beta1.py @@ -0,0 +1,4009 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_upbound_io_v1beta1_cluster.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CloudrunConfigItem(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + loadBalancerType: Optional[str] = None + """ + The load balancer type of CloudRun ingress service. It is external load balancer by default. + Set load_balancer_type=LOAD_BALANCER_TYPE_INTERNAL to configure it as internal load balancer. + """ + + +class ConfigConnectorConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class DnsCacheConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcePersistentDiskCsiDriverConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcpFilestoreCsiDriverConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcsFuseCsiDriverConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GkeBackupAgentConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class HorizontalPodAutoscalingItem(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class HttpLoadBalancingItem(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class LustreCsiDriverConfigItem(BaseModel): + enableLegacyLustrePort: Optional[bool] = None + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class NetworkPolicyConfigItem(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class ParallelstoreCsiDriverConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayClusterLoggingConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayClusterMonitoringConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayOperatorConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + rayClusterLoggingConfig: Optional[List[RayClusterLoggingConfigItem]] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + rayClusterMonitoringConfig: Optional[List[RayClusterMonitoringConfigItem]] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + + +class StatefulHaConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class AddonsConfigItem(BaseModel): + cloudrunConfig: Optional[List[CloudrunConfigItem]] = None + """ + . Structure is documented below. + """ + configConnectorConfig: Optional[List[ConfigConnectorConfigItem]] = None + """ + . + The status of the ConfigConnector addon. It is disabled by default; Set enabled = true to enable. + """ + dnsCacheConfig: Optional[List[DnsCacheConfigItem]] = None + """ + . + The status of the NodeLocal DNSCache addon. It is disabled by default. + Set enabled = true to enable. + """ + gcePersistentDiskCsiDriverConfig: Optional[ + List[GcePersistentDiskCsiDriverConfigItem] + ] = None + """ + . + Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Set enabled = true to enable. + """ + gcpFilestoreCsiDriverConfig: Optional[List[GcpFilestoreCsiDriverConfigItem]] = None + """ + The status of the Filestore CSI driver addon, + which allows the usage of filestore instance as volumes. + It is disabled by default; set enabled = true to enable. + """ + gcsFuseCsiDriverConfig: Optional[List[GcsFuseCsiDriverConfigItem]] = None + """ + The status of the GCSFuse CSI driver addon, + which allows the usage of a gcs bucket as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is enabled by default for Autopilot clusters with version 1.24 or later; set enabled = true to enable it explicitly. + See Enable the Cloud Storage FUSE CSI driver for more information. + """ + gkeBackupAgentConfig: Optional[List[GkeBackupAgentConfigItem]] = None + """ + . + The status of the Backup for GKE agent addon. It is disabled by default; Set enabled = true to enable. + """ + horizontalPodAutoscaling: Optional[List[HorizontalPodAutoscalingItem]] = None + """ + The status of the Horizontal Pod Autoscaling + addon, which increases or decreases the number of replica pods a replication controller + has based on the resource usage of the existing pods. + It is enabled by default; + set disabled = true to disable. + """ + httpLoadBalancing: Optional[List[HttpLoadBalancingItem]] = None + """ + The status of the HTTP (L7) load balancing + controller addon, which makes it easy to set up HTTP load balancers for services in a + cluster. It is enabled by default; set disabled = true to disable. + """ + lustreCsiDriverConfig: Optional[List[LustreCsiDriverConfigItem]] = None + """ + The status of the Lustre CSI driver addon, + which allows the usage of a Lustre instances as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is disabled by default for Autopilot clusters; set enabled = true to enable. + Lustre CSI Driver Config has optional subfield + enable_legacy_lustre_port which allows the Lustre CSI driver to initialize LNet (the virtual networklayer for Lustre kernel module) using port 6988. + This flag is required to workaround a port conflict with the gke-metadata-server on GKE nodes. + See Enable Lustre CSI driver for more information. + """ + networkPolicyConfig: Optional[List[NetworkPolicyConfigItem]] = None + """ + Whether we should enable the network policy addon + for the master. This must be enabled in order to enable network policy for the nodes. + To enable this, you must also define a network_policy block, + otherwise nothing will happen. + It can only be disabled if the nodes already do not have network policies enabled. + Defaults to disabled; set disabled = false to enable. + """ + parallelstoreCsiDriverConfig: Optional[List[ParallelstoreCsiDriverConfigItem]] = ( + None + ) + """ + The status of the Parallelstore CSI driver addon, + which allows the usage of a Parallelstore instances as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is enabled by default for Autopilot clusters with version 1.29 or later; set enabled = true to enable it explicitly. + See Enable the Parallelstore CSI driver for more information. + """ + rayOperatorConfig: Optional[List[RayOperatorConfigItem]] = None + """ + . The status of the Ray Operator + addon. + It is disabled by default. Set enabled = true to enable. The minimum + cluster version to enable Ray is 1.30.0-gke.1747000. + """ + statefulHaConfig: Optional[List[StatefulHaConfigItem]] = None + """ + . + The status of the Stateful HA addon, which provides automatic configurable failover for stateful applications. + It is disabled by default for Standard clusters. Set enabled = true to enable. + """ + + +class AnonymousAuthenticationConfigItem(BaseModel): + mode: Optional[str] = None + """ + Sets or removes authentication restrictions. Available options include LIMITED and ENABLED. + """ + + +class AuthenticatorGroupsConfigItem(BaseModel): + securityGroup: Optional[str] = None + """ + The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com. + """ + + +class BinaryAuthorizationItem(BaseModel): + enabled: Optional[bool] = None + """ + (DEPRECATED) Enable Binary Authorization for this cluster. Deprecated in favor of evaluation_mode. + """ + evaluationMode: Optional[str] = None + """ + Mode of operation for Binary Authorization policy evaluation. Valid values are DISABLED + and PROJECT_SINGLETON_POLICY_ENFORCE. + """ + + +class ManagementItem(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + + +class ShieldedInstanceConfigItem(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + Defines if the instance has integrity monitoring enabled. + """ + enableSecureBoot: Optional[bool] = None + """ + Defines if the instance has Secure Boot enabled. + """ + + +class StandardRolloutPolicyItem(BaseModel): + batchNodeCount: Optional[float] = None + """ + Number of blue nodes to drain in a batch. Only one of the batch_percentage or batch_node_count can be specified. + """ + batchPercentage: Optional[float] = None + """ + : Percentage of the bool pool nodes to drain in a batch. The range of this field should be (0.0, 1.0). Only one of the batch_percentage or batch_node_count can be specified. + """ + batchSoakDuration: Optional[str] = None + """ + Soak time after each batch gets drained. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".`. + """ + + +class BlueGreenSetting(BaseModel): + nodePoolSoakDuration: Optional[str] = None + """ + Time needed after draining entire blue pool. After this period, blue pool will be cleaned up. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s". + """ + standardRolloutPolicy: Optional[List[StandardRolloutPolicyItem]] = None + """ + green upgrade. To be specified when strategy is set to BLUE_GREEN. Structure is documented below. + """ + + +class UpgradeSetting(BaseModel): + blueGreenSettings: Optional[List[BlueGreenSetting]] = None + """ + Settings for blue-green upgrade strategy. To be specified when strategy is set to BLUE_GREEN. Structure is documented below. + """ + maxSurge: Optional[float] = None + """ + The maximum number of nodes that can be created beyond the current size of the node pool during the upgrade process. To be used when strategy is set to SURGE. Default is 0. + """ + maxUnavailable: Optional[float] = None + """ + The maximum number of nodes that can be simultaneously unavailable during the upgrade process. To be used when strategy is set to SURGE. Default is 0. + """ + strategy: Optional[str] = None + """ + Strategy used for node pool update. Strategy can only be one of BLUE_GREEN or SURGE. The default is value is SURGE. + """ + + +class AutoProvisioningDefault(BaseModel): + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + diskSize: Optional[float] = None + """ + Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. Defaults to 100 + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-standard' + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + management: Optional[List[ManagementItem]] = None + """ + NodeManagement configuration for this NodePool. Structure is documented below. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Shielded Instance options. Structure is documented below. + """ + upgradeSettings: Optional[List[UpgradeSetting]] = None + """ + Specifies the upgrade settings for NAP created node pools. Structure is documented below. + """ + + +class ResourceLimit(BaseModel): + maximum: Optional[float] = None + """ + Maximum amount of the resource in the cluster. + """ + minimum: Optional[float] = None + """ + Minimum amount of the resource in the cluster. + """ + resourceType: Optional[str] = None + """ + The type of the resource. For example, cpu and + memory. See the guide to using Node Auto-Provisioning + for a list of types. + """ + + +class ClusterAutoscalingItem(BaseModel): + autoProvisioningDefaults: Optional[List[AutoProvisioningDefault]] = None + """ + Contains defaults for a node pool created by NAP. A subset of fields also apply to + GKE Autopilot clusters. + Structure is documented below. + """ + autoProvisioningLocations: Optional[List[str]] = None + """ + The list of Google Compute Engine + zones in which the + NodePool's nodes can be created by NAP. + """ + autoscalingProfile: Optional[str] = None + """ + Configuration + options for the Autoscaling profile + feature, which lets you choose whether the cluster autoscaler should optimize for resource utilization or resource availability + when deciding to remove nodes from a cluster. Can be BALANCED or OPTIMIZE_UTILIZATION. Defaults to BALANCED. + """ + enabled: Optional[bool] = None + """ + Whether node auto-provisioning is enabled. Must be supplied for GKE Standard clusters, true is implied + for autopilot clusters. Resource limits for cpu and memory must be defined to enable node auto-provisioning for GKE Standard. + """ + resourceLimits: Optional[List[ResourceLimit]] = None + """ + Global constraints for machine resources in the + cluster. Configuring the cpu and memory types is required if node + auto-provisioning is enabled. These limits will apply to node pool autoscaling + in addition to node auto-provisioning. Structure is documented below. + """ + + +class ConfidentialNode(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class DnsEndpointConfigItem(BaseModel): + allowExternalTraffic: Optional[bool] = None + """ + Controls whether user traffic is allowed over this endpoint. Note that GCP-managed services may still use the endpoint even if this is false. + """ + endpoint: Optional[str] = None + """ + (Output) The cluster's DNS endpoint. + """ + + +class IpEndpointsConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Controls whether to allow direct IP access. Defaults to true. + """ + + +class ControlPlaneEndpointsConfigItem(BaseModel): + dnsEndpointConfig: Optional[List[DnsEndpointConfigItem]] = None + """ + DNS endpoint configuration. + """ + ipEndpointsConfig: Optional[List[IpEndpointsConfigItem]] = None + """ + IP endpoint configuration. + """ + + +class CostManagementConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Whether to enable the cost allocation feature. + """ + + +class DatabaseEncryptionItem(BaseModel): + keyName: Optional[str] = None + """ + the key to use to encrypt/decrypt secrets. See the DatabaseEncryption definition for more information. + """ + state: Optional[str] = None + """ + ENCRYPTED or DECRYPTED + """ + + +class DefaultSnatStatu(BaseModel): + disabled: Optional[bool] = None + """ + Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when defaultSnatStatus is disabled.When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic + """ + + +class DnsConfigItem(BaseModel): + additiveVpcScopeDnsDomain: Optional[str] = None + """ + This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = "CLOUD_DNS" and cluster_dns_scope = "CLUSTER_SCOPE" must both be set as well. + """ + clusterDns: Optional[str] = None + """ + Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS. + """ + clusterDnsDomain: Optional[str] = None + """ + The suffix used for all cluster service records. + """ + clusterDnsScope: Optional[str] = None + """ + The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. + """ + + +class EnableK8SBetaApi(BaseModel): + enabledApis: Optional[List[str]] = None + """ + Enabled Kubernetes Beta APIs. To list a Beta API resource, use the representation {group}/{version}/{resource}. The version must be a Beta version. Note that you cannot disable beta APIs that are already enabled on a cluster without recreating it. See the Configure beta APIs for more information. + """ + + +class EnterpriseConfigItem(BaseModel): + desiredTier: Optional[str] = None + """ + Sets the tier of the cluster. Available options include STANDARD and ENTERPRISE. + """ + + +class FleetItem(BaseModel): + project: Optional[str] = None + """ + The name of the Fleet host project where this cluster will be registered. + """ + + +class GatewayApiConfigItem(BaseModel): + channel: Optional[str] = None + """ + Which Gateway Api channel should be used. CHANNEL_DISABLED, CHANNEL_EXPERIMENTAL or CHANNEL_STANDARD. + """ + + +class GkeAutoUpgradeConfigItem(BaseModel): + patchMode: Optional[str] = None + """ + The selected patch mode. + Accepted values are: + """ + + +class IdentityServiceConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Whether to enable the Identity Service component. It is disabled by default. Set enabled=true to enable. + """ + + +class AdditionalIpRangesConfigItem(BaseModel): + podIpv4RangeNames: Optional[List[str]] = None + """ + List of secondary ranges names within this subnetwork that can be used for pod IPs. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class AdditionalPodRangesConfigItem(BaseModel): + podRangeNames: Optional[List[str]] = None + """ + The names of the Pod ranges to add to the cluster. + """ + + +class PodCidrOverprovisionConfigItem(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class IpAllocationPolicyItem(BaseModel): + additionalIpRangesConfig: Optional[List[AdditionalIpRangesConfigItem]] = None + """ + The configuration for individual additional subnetworks attached to the cluster. + Structure is documented below. + """ + additionalPodRangesConfig: Optional[List[AdditionalPodRangesConfigItem]] = None + """ + The configuration for additional pod secondary ranges at + the cluster level. Used for Autopilot clusters and Standard clusters with which control of the + secondary Pod IP address assignment to node pools isn't needed. Structure is documented below. + """ + clusterIpv4CidrBlock: Optional[str] = None + """ + The IP address range for the cluster pod IPs. + Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) + to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) + from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to + pick a specific range to use. + """ + clusterSecondaryRangeName: Optional[str] = None + """ + The name of the existing secondary + range in the cluster's subnetwork to use for pod IP addresses. Alternatively, + cluster_ipv4_cidr_block can be used to automatically create a GKE-managed one. + """ + podCidrOverprovisionConfig: Optional[List[PodCidrOverprovisionConfigItem]] = None + servicesIpv4CidrBlock: Optional[str] = None + """ + The IP address range of the services IPs in this cluster. + Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) + to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) + from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to + pick a specific range to use. + """ + servicesSecondaryRangeName: Optional[str] = None + """ + The name of the existing + secondary range in the cluster's subnetwork to use for service ClusterIPs. + Alternatively, services_ipv4_cidr_block can be used to automatically create a + GKE-managed one. + """ + stackType: Optional[str] = None + """ + The IP Stack Type of the cluster. + Default value is IPV4. + Possible values are IPV4 and IPV4_IPV6. + """ + + +class LoggingConfigItem(BaseModel): + enableComponents: Optional[List[str]] = None + """ + The GKE components exposing logs. Supported values include: + SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. + """ + + +class DailyMaintenanceWindowItem(BaseModel): + startTime: Optional[str] = None + + +class ExclusionOption(BaseModel): + scope: Optional[str] = None + """ + The scope of automatic upgrades to restrict in the exclusion window. One of: NO_UPGRADES | NO_MINOR_UPGRADES | NO_MINOR_OR_NODE_UPGRADES + """ + + +class MaintenanceExclusionItem(BaseModel): + endTime: Optional[str] = None + exclusionName: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + exclusionOptions: Optional[List[ExclusionOption]] = None + """ + MaintenanceExclusionOptions provides maintenance exclusion related options. + """ + startTime: Optional[str] = None + + +class RecurringWindowItem(BaseModel): + endTime: Optional[str] = None + recurrence: Optional[str] = None + startTime: Optional[str] = None + + +class MaintenancePolicyItem(BaseModel): + dailyMaintenanceWindow: Optional[List[DailyMaintenanceWindowItem]] = None + """ + structure documented below. + """ + maintenanceExclusion: Optional[List[MaintenanceExclusionItem]] = None + """ + structure documented below + """ + recurringWindow: Optional[List[RecurringWindowItem]] = None + """ + structure documented below + """ + + +class ClientCertificateConfigItem(BaseModel): + issueClientCertificate: Optional[bool] = None + + +class MasterAuthItem(BaseModel): + clientCertificateConfig: Optional[List[ClientCertificateConfigItem]] = None + """ + Whether client certificate authorization is enabled for this cluster. For example: + """ + + +class CidrBlock(BaseModel): + cidrBlock: Optional[str] = None + """ + External network that can access Kubernetes master through HTTPS. + Must be specified in CIDR notation. + """ + displayName: Optional[str] = None + """ + Field for users to identify CIDR blocks. + """ + + +class MasterAuthorizedNetworksConfigItem(BaseModel): + cidrBlocks: Optional[List[CidrBlock]] = None + """ + External networks that can access the + Kubernetes cluster master through HTTPS. + """ + gcpPublicCidrsAccessEnabled: Optional[bool] = None + """ + Whether Kubernetes master is + accessible via Google Compute Engine Public IPs. + """ + privateEndpointEnforcementEnabled: Optional[bool] = None + """ + Whether authorized networks is enforced on the private endpoint or not. + """ + + +class MeshCertificate(BaseModel): + enableCertificates: Optional[bool] = None + """ + Controls the issuance of workload mTLS certificates. It is enabled by default. Workload Identity is required, see workload_config. + """ + + +class AdvancedDatapathObservabilityConfigItem(BaseModel): + enableMetrics: Optional[bool] = None + """ + Whether or not to enable advanced datapath metrics. + """ + enableRelay: Optional[bool] = None + """ + Whether or not Relay is enabled. + """ + + +class AutoMonitoringConfigItem(BaseModel): + scope: Optional[str] = None + """ + Whether or not to enable GKE Auto-Monitoring. Supported values include: ALL, NONE. + """ + + +class ManagedPrometheu(BaseModel): + autoMonitoringConfig: Optional[List[AutoMonitoringConfigItem]] = None + """ + Configuration options for GKE Auto-Monitoring. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class MonitoringConfigItem(BaseModel): + advancedDatapathObservabilityConfig: Optional[ + List[AdvancedDatapathObservabilityConfigItem] + ] = None + """ + Configuration for Advanced Datapath Monitoring. Structure is documented below. + """ + enableComponents: Optional[List[str]] = None + """ + The GKE components exposing metrics. Supported values include: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT and STATEFULSET. In beta provider, WORKLOADS is supported on top of those 10 values. (WORKLOADS is deprecated and removed in GKE 1.24.) + """ + managedPrometheus: Optional[List[ManagedPrometheu]] = None + """ + Configuration for Managed Service for Prometheus. Structure is documented below. + """ + + +class NetworkPerformanceConfigItem(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + Specifies the total network bandwidth tier for NodePools in the cluster. + """ + + +class NetworkPolicyItem(BaseModel): + enabled: Optional[bool] = None + """ + Whether network policy is enabled on the cluster. + """ + provider: Optional[str] = None + """ + The selected network policy provider. Defaults to PROVIDER_UNSPECIFIED. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AdvancedMachineFeature(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + performanceMonitoringUnit: Optional[str] = None + """ + Defines the performance monitoring unit PMU level. Valid values are ARCHITECTURAL, STANDARD, or ENHANCED. Defaults to off. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + """ + + +class ConfidentialNodeModel(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcpSecretManagerCertificateConfigItem(BaseModel): + secretUri: Optional[str] = None + + +class CertificateAuthorityDomainConfigItem(BaseModel): + fqdns: Optional[List[str]] = None + gcpSecretManagerCertificateConfig: Optional[ + List[GcpSecretManagerCertificateConfigItem] + ] = None + + +class PrivateRegistryAccessConfigItem(BaseModel): + certificateAuthorityDomainConfig: Optional[ + List[CertificateAuthorityDomainConfigItem] + ] = None + """ + List of configuration objects for CA and domains. Each object identifies a certificate and its assigned domains. See how to configure for private container registries for more detail. Example: + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class ContainerdConfigItem(BaseModel): + privateRegistryAccessConfig: Optional[List[PrivateRegistryAccessConfigItem]] = None + """ + Configuration for private container registries. There are two fields in this config: + """ + + +class EphemeralStorageLocalSsdConfigItem(BaseModel): + dataCacheCount: Optional[float] = None + """ + Number of raw-block local NVMe SSD disks to be attached to the node utilized for GKE Data Cache. If zero, then GKE Data Cache will not be enabled in the nodes. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + + +class FastSocketItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcfsConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GpuDriverInstallationConfigItem(BaseModel): + gpuDriverVersion: Optional[str] = None + """ + Mode for how the GPU driver is installed. + Accepted values are: + """ + + +class GpuSharingConfigItem(BaseModel): + gpuSharingStrategy: Optional[str] = None + """ + The type of GPU sharing strategy to enable on the GPU node. + Accepted values are: + """ + maxSharedClientsPerGpu: Optional[float] = None + """ + The maximum number of containers that can share a GPU. + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + gpuDriverInstallationConfig: Optional[List[GpuDriverInstallationConfigItem]] = None + """ + Configuration for auto installation of GPU driver. Structure is documented below. + """ + gpuPartitionSize: Optional[str] = None + """ + Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide. + """ + gpuSharingConfig: Optional[List[GpuSharingConfigItem]] = None + """ + Configuration for GPU sharing. Structure is documented below. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class GvnicItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class HostMaintenancePolicyItem(BaseModel): + maintenanceInterval: Optional[str] = None + + +class KubeletConfigItem(BaseModel): + allowedUnsafeSysctls: Optional[List[str]] = None + """ + Defines a comma-separated allowlist of unsafe sysctls or sysctl patterns which can be set on the Pods. The allowed sysctl groups are kernel.shm*, kernel.msg*, kernel.sem, fs.mqueue.*, and net.*. + """ + containerLogMaxFiles: Optional[float] = None + """ + Defines the maximum number of container log files that can be present for a container. The integer must be between 2 and 10, inclusive. + """ + containerLogMaxSize: Optional[str] = None + """ + Defines the maximum size of the + container log file before it is rotated. Specified as a positive number and a + unit suffix, such as "100Ki", "10Mi". Valid units are "Ki", "Mi", "Gi". + The value must be between "10Mi" and "500Mi", inclusive. And the total container log size + (container_log_max_size * container_log_max_files) cannot exceed 1% of the total storage of the node. + """ + cpuCfsQuota: Optional[bool] = None + """ + If true, enables CPU CFS quota enforcement for + containers that specify CPU limits. + """ + cpuCfsQuotaPeriod: Optional[str] = None + """ + The CPU CFS quota period value. Specified + as a sequence of decimal numbers, each with optional fraction and a unit suffix, + such as "300ms". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", + "h". The value must be a positive duration. + """ + cpuManagerPolicy: Optional[str] = None + """ + The CPU management policy on the node. See + K8S CPU Management Policies. + One of "none" or "static". If unset (or set to the empty string ""), the API will treat the field as if set to "none". + Prior to the 6.4.0 this field was marked as required. The workaround for the required field + is setting the empty string "", which will function identically to not setting this field. + """ + imageGcHighThresholdPercent: Optional[float] = None + """ + Defines the percent of disk usage after which image garbage collection is always run. The integer must be between 10 and 85, inclusive. + """ + imageGcLowThresholdPercent: Optional[float] = None + """ + Defines the percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. The integer must be between 10 and 85, inclusive. + """ + imageMaximumGcAge: Optional[str] = None + """ + Defines the maximum age an image can be unused before it is garbage collected. Specified as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300s", "1.5m", and "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". The value must be a positive duration. + """ + imageMinimumGcAge: Optional[str] = None + """ + Defines the minimum age for an unused image before it is garbage collected. Specified as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300s", "1.5m". The value cannot be greater than "2m". + """ + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + podPidsLimit: Optional[float] = None + """ + Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. + """ + + +class HugepagesConfigItem(BaseModel): + hugepageSize1G: Optional[float] = None + """ + Amount of 1G hugepages. + """ + hugepageSize2M: Optional[float] = None + """ + Amount of 2M hugepages. + """ + + +class LinuxNodeConfigItem(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[List[HugepagesConfigItem]] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class LocalNvmeSsdBlockConfigItem(BaseModel): + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + + +class ReservationAffinityItem(BaseModel): + consumeReservationType: Optional[str] = None + """ + The type of reservation consumption + Accepted values are: + """ + key: Optional[str] = None + """ + Key for taint. + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SecondaryBootDisk(BaseModel): + diskImage: Optional[str] = None + """ + Path to disk image to create the secondary boot disk from. After using the gke-disk-image-builder, this argument should be global/images/DISK_IMAGE_NAME. + """ + mode: Optional[str] = None + """ + How to expose the node metadata to the workload running on the node. + Accepted values are: + """ + + +class ServiceAccountRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NodeAffinityItem(BaseModel): + key: Optional[str] = None + """ + Key for taint. + """ + operator: Optional[str] = None + """ + Specifies affinity or anti-affinity. Accepted values are "IN" or "NOT_IN" + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SoleTenantConfigItem(BaseModel): + nodeAffinity: Optional[List[NodeAffinityItem]] = None + + +class TaintItem(BaseModel): + effect: Optional[str] = None + """ + Effect for taint. Accepted values are NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE. + """ + key: Optional[str] = None + """ + Key for taint. + """ + value: Optional[str] = None + """ + Value for taint. + """ + + +class WindowsNodeConfigItem(BaseModel): + osversion: Optional[str] = None + + +class WorkloadMetadataConfigItem(BaseModel): + mode: Optional[str] = None + """ + How to expose the node metadata to the workload running on the node. + Accepted values are: + """ + + +class NodeConfigItem(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[List[ConfidentialNodeModel]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[List[ContainerdConfigItem]] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[ + List[EphemeralStorageLocalSsdConfigItem] + ] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[List[FastSocketItem]] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[List[GcfsConfigItem]] = None + """ + Parameters for the Google Container Filesystem (GCFS). + If unspecified, GCFS will not be enabled on the node pool. When enabling this feature you must specify image_type = "COS_CONTAINERD" and node_version from GKE versions 1.19 or later to use it. + For GKE versions 1.19, 1.20, and 1.21, the recommended minimum node_version would be 1.19.15-gke.1300, 1.20.11-gke.1300, and 1.21.5-gke.1300 respectively. + A machine_type that has more than 16 GiB of memory is also recommended. + GCFS must be enabled in order to use image streaming. + Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[List[GvnicItem]] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[List[HostMaintenancePolicyItem]] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[List[KubeletConfigItem]] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[List[LinuxNodeConfigItem]] = None + """ + Parameters that can be configured on Linux nodes. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[List[LocalNvmeSsdBlockConfigItem]] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + wide default value. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCP labels (key/value pairs) to be applied to each node. Refer here + for how these labels are applied to clusters, node pools and nodes. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + serviceAccountRef: Optional[ServiceAccountRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccount. + """ + serviceAccountSelector: Optional[ServiceAccountSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccount. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[List[SoleTenantConfigItem]] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[List[WindowsNodeConfigItem]] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[List[WorkloadMetadataConfigItem]] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class LinuxNodeConfigItemModel(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class NetworkTag(BaseModel): + tags: Optional[List[str]] = None + """ + List of network tags applied to auto-provisioned node pools. + """ + + +class NodeKubeletConfigItem(BaseModel): + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + Controls whether the kubelet read-only port is enabled. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + + +class NodePoolAutoConfigItem(BaseModel): + linuxNodeConfig: Optional[List[LinuxNodeConfigItemModel]] = None + """ + Linux system configuration for the cluster's automatically provisioned node pools. Only cgroup_mode field is supported in node_pool_auto_config. Structure is documented below. + """ + networkTags: Optional[List[NetworkTag]] = None + """ + The network tag config for the cluster's automatically provisioned node pools. + """ + nodeKubeletConfig: Optional[List[NodeKubeletConfigItem]] = None + """ + Kubelet configuration for Autopilot clusters. Currently, only insecure_kubelet_readonly_port_enabled is supported here. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + + +class NodeConfigDefault(BaseModel): + containerdConfig: Optional[List[ContainerdConfigItem]] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + gcfsConfig: Optional[List[GcfsConfigItem]] = None + """ + The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable image streaming across all the node pools within the cluster. Structure is documented below. + """ + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + loggingVariant: Optional[str] = None + """ + The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + + +class NodePoolDefault(BaseModel): + nodeConfigDefaults: Optional[List[NodeConfigDefault]] = None + """ + Subset of NodeConfig message that has defaults. + """ + + +class FilterItem(BaseModel): + eventType: Optional[List[str]] = None + """ + Can be used to filter what notifications are sent. Accepted values are UPGRADE_AVAILABLE_EVENT, UPGRADE_EVENT and SECURITY_BULLETIN_EVENT. See Filtering notifications for more details. + """ + + +class PubsubItem(BaseModel): + enabled: Optional[bool] = None + """ + Whether or not the notification config is enabled + """ + filter: Optional[List[FilterItem]] = None + """ + Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Structure is documented below. + """ + topic: Optional[str] = None + """ + The pubsub topic to push upgrade notifications to. Must be in the same project as the cluster. Must be in the format: projects/{project}/topics/{topic}. + """ + + +class NotificationConfigItem(BaseModel): + pubsub: Optional[List[PubsubItem]] = None + """ + The pubsub config for the cluster's upgrade notifications. + """ + + +class PodAutoscalingItem(BaseModel): + hpaProfile: Optional[str] = None + """ + Enable the Horizontal Pod Autoscaling profile for this cluster. + Acceptable values are: + """ + + +class MasterGlobalAccessConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Whether the cluster master is accessible globally or + not. + """ + + +class PrivateEndpointSubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PrivateEndpointSubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PrivateClusterConfigItem(BaseModel): + enablePrivateEndpoint: Optional[bool] = None + """ + When true, the cluster's private + endpoint is used as the cluster endpoint and access through the public endpoint + is disabled. When false, either endpoint can be used. This field only applies + to private clusters, when enable_private_nodes is true. + """ + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + masterGlobalAccessConfig: Optional[List[MasterGlobalAccessConfigItem]] = None + """ + Controls cluster master global + access settings. Structure is documented below. + """ + masterIpv4CidrBlock: Optional[str] = None + """ + The IP range in CIDR notation to use for + the hosted master network. This range will be used for assigning private IP + addresses to the cluster master(s) and the ILB VIP. This range must not overlap + with any other ranges in use within the cluster's network, and it must be a /28 + subnet. See Private Cluster Limitations + for more details. This field only applies to private clusters, when + enable_private_nodes is true. + """ + privateEndpointSubnetwork: Optional[str] = None + """ + Subnetwork in cluster's network where master's endpoint will be provisioned. + """ + privateEndpointSubnetworkRef: Optional[PrivateEndpointSubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate privateEndpointSubnetwork. + """ + privateEndpointSubnetworkSelector: Optional[PrivateEndpointSubnetworkSelector] = ( + None + ) + """ + Selector for a Subnetwork in compute to populate privateEndpointSubnetwork. + """ + + +class RbacBindingConfigItem(BaseModel): + enableInsecureBindingSystemAuthenticated: Optional[bool] = None + """ + Setting this to true will allow any ClusterRoleBinding and RoleBinding with subjects system:authenticated. + """ + enableInsecureBindingSystemUnauthenticated: Optional[bool] = None + """ + Setting this to true will allow any ClusterRoleBinding and RoleBinding with subjects system:anonymous or system:unauthenticated. + """ + + +class ReleaseChannelItem(BaseModel): + channel: Optional[str] = None + """ + The selected release channel. + Accepted values are: + """ + + +class BigqueryDestinationItem(BaseModel): + datasetId: Optional[str] = None + """ + The ID of a BigQuery Dataset. For Example: + """ + + +class ResourceUsageExportConfigItem(BaseModel): + bigqueryDestination: Optional[List[BigqueryDestinationItem]] = None + """ + Parameters for using BigQuery as the destination of resource usage export. + """ + enableNetworkEgressMetering: Optional[bool] = None + """ + Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created + in the cluster to meter network egress traffic. + """ + enableResourceConsumptionMetering: Optional[bool] = None + """ + Whether to enable resource + consumption metering on this cluster. When enabled, a table will be created in + the resource export BigQuery dataset to store resource consumption data. The + resulting table can be joined with the resource usage table or with BigQuery + billing export. Defaults to true. + """ + + +class SecretManagerConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enable the Secret Manager add-on for this cluster. + """ + + +class SecurityPostureConfigItem(BaseModel): + mode: Optional[str] = None + """ + Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include DISABLED and BASIC. + """ + vulnerabilityMode: Optional[str] = None + """ + Sets the mode of the Kubernetes security posture API's workload vulnerability scanning. Available options include VULNERABILITY_DISABLED, VULNERABILITY_BASIC and VULNERABILITY_ENTERPRISE. + """ + + +class ServiceExternalIpsConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Controls whether external ips specified by a service will be allowed. It is enabled by default. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UserManagedKeysConfigItem(BaseModel): + aggregationCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the aggreation CA in this cluster. + """ + clusterCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the cluster CA in this cluster. + """ + controlPlaneDiskEncryptionKey: Optional[str] = None + """ + The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control plane nodes. + """ + etcdApiCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the etcd API CA in this cluster. + """ + etcdPeerCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the etcd peer CA in this cluster. + """ + gkeopsEtcdBackupEncryptionKey: Optional[str] = None + """ + Resource path of the Cloud KMS cryptoKey to use for encryption of internal etcd backups. + """ + serviceAccountSigningKeys: Optional[List[str]] = None + """ + The Cloud KMS cryptoKeyVersions to use for signing service account JWTs issued by this cluster. + """ + serviceAccountVerificationKeys: Optional[List[str]] = None + """ + The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs issued by this cluster. + """ + + +class VerticalPodAutoscalingItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class WorkloadIdentityConfigItem(BaseModel): + workloadPool: Optional[str] = None + """ + The workload pool to attach all Kubernetes service accounts to. + """ + + +class ForProvider(BaseModel): + addonsConfig: Optional[List[AddonsConfigItem]] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[List[AnonymousAuthenticationConfigItem]] = ( + None + ) + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[List[AuthenticatorGroupsConfigItem]] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[List[BinaryAuthorizationItem]] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[List[ClusterAutoscalingItem]] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[List[ConfidentialNode]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[List[ControlPlaneEndpointsConfigItem]] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[List[CostManagementConfigItem]] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[List[DatabaseEncryptionItem]] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[List[DefaultSnatStatu]] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[List[DnsConfigItem]] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[List[EnableK8SBetaApi]] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + enterpriseConfig: Optional[List[EnterpriseConfigItem]] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[List[FleetItem]] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[List[GatewayApiConfigItem]] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[List[GkeAutoUpgradeConfigItem]] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + identityServiceConfig: Optional[List[IdentityServiceConfigItem]] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[List[IpAllocationPolicyItem]] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + location: str + """ + The location (region or zone) in which the cluster + master will be created, as well as the default node location. If you specify a + zone (such as us-central1-a), the cluster will be a zonal cluster with a + single cluster master. If you specify a region (such as us-west1), the + cluster will be a regional cluster with multiple masters spread across zones in + the region, and with default node locations in those zones as well + """ + loggingConfig: Optional[List[LoggingConfigItem]] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[List[MaintenancePolicyItem]] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[List[MasterAuthItem]] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[ + List[MasterAuthorizedNetworksConfigItem] + ] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + meshCertificates: Optional[List[MeshCertificate]] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[List[MonitoringConfigItem]] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[List[NetworkPolicyItem]] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[List[NodeConfigItem]] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePoolAutoConfig: Optional[List[NodePoolAutoConfigItem]] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[List[NodePoolDefault]] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[List[NotificationConfigItem]] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + podAutoscaling: Optional[List[PodAutoscalingItem]] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[List[PrivateClusterConfigItem]] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[List[RbacBindingConfigItem]] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[List[ReleaseChannelItem]] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[List[ResourceUsageExportConfigItem]] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[List[SecretManagerConfigItem]] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[List[SecurityPostureConfigItem]] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + serviceExternalIpsConfig: Optional[List[ServiceExternalIpsConfigItem]] = None + """ + Structure is documented below. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + userManagedKeysConfig: Optional[List[UserManagedKeysConfigItem]] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[List[VerticalPodAutoscalingItem]] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[List[WorkloadIdentityConfigItem]] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class ConfidentialNodeModel1(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class ConfidentialNodeModel2(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class LinuxNodeConfigItemModel1(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[List[HugepagesConfigItem]] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class LinuxNodeConfigItemModel2(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class InitProvider(BaseModel): + addonsConfig: Optional[List[AddonsConfigItem]] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[List[AnonymousAuthenticationConfigItem]] = ( + None + ) + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[List[AuthenticatorGroupsConfigItem]] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[List[BinaryAuthorizationItem]] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[List[ClusterAutoscalingItem]] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[List[ConfidentialNodeModel1]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[List[ControlPlaneEndpointsConfigItem]] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[List[CostManagementConfigItem]] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[List[DatabaseEncryptionItem]] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[List[DefaultSnatStatu]] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[List[DnsConfigItem]] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[List[EnableK8SBetaApi]] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + enterpriseConfig: Optional[List[EnterpriseConfigItem]] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[List[FleetItem]] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[List[GatewayApiConfigItem]] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[List[GkeAutoUpgradeConfigItem]] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + identityServiceConfig: Optional[List[IdentityServiceConfigItem]] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[List[IpAllocationPolicyItem]] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + loggingConfig: Optional[List[LoggingConfigItem]] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[List[MaintenancePolicyItem]] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[List[MasterAuthItem]] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[ + List[MasterAuthorizedNetworksConfigItem] + ] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + meshCertificates: Optional[List[MeshCertificate]] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[List[MonitoringConfigItem]] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[List[NetworkPolicyItem]] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[List[NodeConfigItem]] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePoolAutoConfig: Optional[List[NodePoolAutoConfigItem]] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[List[NodePoolDefault]] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[List[NotificationConfigItem]] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + podAutoscaling: Optional[List[PodAutoscalingItem]] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[List[PrivateClusterConfigItem]] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[List[RbacBindingConfigItem]] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[List[ReleaseChannelItem]] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[List[ResourceUsageExportConfigItem]] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[List[SecretManagerConfigItem]] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[List[SecurityPostureConfigItem]] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + serviceExternalIpsConfig: Optional[List[ServiceExternalIpsConfigItem]] = None + """ + Structure is documented below. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + userManagedKeysConfig: Optional[List[UserManagedKeysConfigItem]] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[List[VerticalPodAutoscalingItem]] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[List[WorkloadIdentityConfigItem]] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UpgradeOption(BaseModel): + autoUpgradeStartTime: Optional[str] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + + +class ManagementItemModel(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + upgradeOptions: Optional[List[UpgradeOption]] = None + """ + Specifies the Auto Upgrade knobs for the node pool. + """ + + +class ConfidentialNodeModel3(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class EnterpriseConfigItemModel(BaseModel): + clusterTier: Optional[str] = None + """ + The effective tier of the cluster. + """ + desiredTier: Optional[str] = None + """ + Sets the tier of the cluster. Available options include STANDARD and ENTERPRISE. + """ + + +class FleetItemModel(BaseModel): + membership: Optional[str] = None + """ + The resource name of the fleet Membership resource associated to this cluster with format //gkehub.googleapis.com/projects/{{project}}/locations/{{location}}/memberships/{{name}}. See the official doc for fleet management. + """ + membershipId: Optional[str] = None + """ + The short name of the fleet membership, extracted from fleet.0.membership. You can use this field to configure membership_id under google_gkehub_feature_membership. + """ + membershipLocation: Optional[str] = None + """ + The location of the fleet membership, extracted from fleet.0.membership. You can use this field to configure membership_location under google_gkehub_feature_membership. + """ + preRegistered: Optional[bool] = None + project: Optional[str] = None + """ + The name of the Fleet host project where this cluster will be registered. + """ + + +class DailyMaintenanceWindowItemModel(BaseModel): + duration: Optional[str] = None + """ + Duration of the time window, automatically chosen to be + smallest possible in the given scenario. + Duration will be in RFC3339 format "PTnHnMnS". + """ + startTime: Optional[str] = None + + +class MasterAuthItemModel(BaseModel): + clientCertificate: Optional[str] = None + """ + Base64 encoded public certificate + used by clients to authenticate to the cluster endpoint. + """ + clientCertificateConfig: Optional[List[ClientCertificateConfigItem]] = None + """ + Whether client certificate authorization is enabled for this cluster. For example: + """ + clusterCaCertificate: Optional[str] = None + """ + Base64 encoded public certificate + that is the root certificate of the cluster. + """ + + +class ConfidentialNodeModel4(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class EffectiveTaint(BaseModel): + effect: Optional[str] = None + """ + Effect for taint. Accepted values are NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE. + """ + key: Optional[str] = None + """ + Key for taint. + """ + value: Optional[str] = None + """ + Value for taint. + """ + + +class LinuxNodeConfigItemModel3(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[List[HugepagesConfigItem]] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class NodeConfigItemModel(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[List[ConfidentialNodeModel4]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[List[ContainerdConfigItem]] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + effectiveTaints: Optional[List[EffectiveTaint]] = None + """ + List of kubernetes taints applied to each node. Structure is documented above. + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[ + List[EphemeralStorageLocalSsdConfigItem] + ] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[List[FastSocketItem]] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[List[GcfsConfigItem]] = None + """ + Parameters for the Google Container Filesystem (GCFS). + If unspecified, GCFS will not be enabled on the node pool. When enabling this feature you must specify image_type = "COS_CONTAINERD" and node_version from GKE versions 1.19 or later to use it. + For GKE versions 1.19, 1.20, and 1.21, the recommended minimum node_version would be 1.19.15-gke.1300, 1.20.11-gke.1300, and 1.21.5-gke.1300 respectively. + A machine_type that has more than 16 GiB of memory is also recommended. + GCFS must be enabled in order to use image streaming. + Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[List[GvnicItem]] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[List[HostMaintenancePolicyItem]] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[List[KubeletConfigItem]] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[List[LinuxNodeConfigItemModel3]] = None + """ + Parameters that can be configured on Linux nodes. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[List[LocalNvmeSsdBlockConfigItem]] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + wide default value. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCP labels (key/value pairs) to be applied to each node. Refer here + for how these labels are applied to clusters, node pools and nodes. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[List[SoleTenantConfigItem]] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[List[WindowsNodeConfigItem]] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[List[WorkloadMetadataConfigItem]] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class AutoscalingItem(BaseModel): + locationPolicy: Optional[str] = None + maxNodeCount: Optional[float] = None + minNodeCount: Optional[float] = None + totalMaxNodeCount: Optional[float] = None + totalMinNodeCount: Optional[float] = None + + +class ManagementItemModel1(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + + +class AdditionalNodeNetworkConfig(BaseModel): + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class AdditionalPodNetworkConfig(BaseModel): + maxPodsPerNode: Optional[float] = None + secondaryPodRange: Optional[str] = None + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class NetworkConfigItem(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + createPodRange: Optional[bool] = None + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + Network bandwidth tier configuration. + """ + podCidrOverprovisionConfig: Optional[List[PodCidrOverprovisionConfigItem]] = None + podIpv4CidrBlock: Optional[str] = None + podRange: Optional[str] = None + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class NodeConfigItemModel1(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[List[ConfidentialNodeModel4]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + containerdConfig: Optional[List[ContainerdConfigItem]] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-standard' + """ + effectiveTaints: Optional[List[EffectiveTaint]] = None + """ + List of kubernetes taints applied to each node. Structure is documented above. + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[ + List[EphemeralStorageLocalSsdConfigItem] + ] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[List[FastSocketItem]] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[List[GcfsConfigItem]] = None + """ + The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable image streaming across all the node pools within the cluster. Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below.12 this field is an + Attribute as Block + """ + gvnic: Optional[List[GvnicItem]] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[List[HostMaintenancePolicyItem]] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[List[KubeletConfigItem]] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[List[LinuxNodeConfigItemModel3]] = None + """ + Parameters that can be configured on Linux nodes. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[List[LocalNvmeSsdBlockConfigItem]] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[List[SoleTenantConfigItem]] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + List of network tags applied to auto-provisioned node pools. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[List[WindowsNodeConfigItem]] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[List[WorkloadMetadataConfigItem]] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class PlacementPolicyItem(BaseModel): + policyName: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + tpuTopology: Optional[str] = None + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class QueuedProvisioningItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class NodePoolItem(BaseModel): + autoscaling: Optional[List[AutoscalingItem]] = None + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + instanceGroupUrls: Optional[List[str]] = None + managedInstanceGroupUrls: Optional[List[str]] = None + management: Optional[List[ManagementItemModel1]] = None + """ + NodeManagement configuration for this NodePool. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + name: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + namePrefix: Optional[str] = None + networkConfig: Optional[List[NetworkConfigItem]] = None + nodeConfig: Optional[List[NodeConfigItemModel1]] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeCount: Optional[float] = None + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + placementPolicy: Optional[List[PlacementPolicyItem]] = None + queuedProvisioning: Optional[List[QueuedProvisioningItem]] = None + upgradeSettings: Optional[List[UpgradeSetting]] = None + """ + Specifies the upgrade settings for NAP created node pools. Structure is documented below. + """ + version: Optional[str] = None + + +class LinuxNodeConfigItemModel4(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class PrivateClusterConfigItemModel(BaseModel): + enablePrivateEndpoint: Optional[bool] = None + """ + When true, the cluster's private + endpoint is used as the cluster endpoint and access through the public endpoint + is disabled. When false, either endpoint can be used. This field only applies + to private clusters, when enable_private_nodes is true. + """ + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + masterGlobalAccessConfig: Optional[List[MasterGlobalAccessConfigItem]] = None + """ + Controls cluster master global + access settings. Structure is documented below. + """ + masterIpv4CidrBlock: Optional[str] = None + """ + The IP range in CIDR notation to use for + the hosted master network. This range will be used for assigning private IP + addresses to the cluster master(s) and the ILB VIP. This range must not overlap + with any other ranges in use within the cluster's network, and it must be a /28 + subnet. See Private Cluster Limitations + for more details. This field only applies to private clusters, when + enable_private_nodes is true. + """ + peeringName: Optional[str] = None + """ + The name of the peering between this cluster and the Google owned VPC. + """ + privateEndpoint: Optional[str] = None + """ + The internal IP address of this cluster's master endpoint. + """ + privateEndpointSubnetwork: Optional[str] = None + """ + Subnetwork in cluster's network where master's endpoint will be provisioned. + """ + publicEndpoint: Optional[str] = None + """ + The external IP address of this cluster's master endpoint. + """ + + +class AtProvider(BaseModel): + addonsConfig: Optional[List[AddonsConfigItem]] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[List[AnonymousAuthenticationConfigItem]] = ( + None + ) + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[List[AuthenticatorGroupsConfigItem]] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[List[BinaryAuthorizationItem]] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[List[ClusterAutoscalingItem]] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[List[ConfidentialNodeModel3]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[List[ControlPlaneEndpointsConfigItem]] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[List[CostManagementConfigItem]] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[List[DatabaseEncryptionItem]] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[List[DefaultSnatStatu]] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[List[DnsConfigItem]] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + effectiveLabels: Optional[Dict[str, str]] = None + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[List[EnableK8SBetaApi]] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + endpoint: Optional[str] = None + """ + The IP address of this cluster's Kubernetes master. + """ + enterpriseConfig: Optional[List[EnterpriseConfigItemModel]] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[List[FleetItemModel]] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[List[GatewayApiConfigItem]] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[List[GkeAutoUpgradeConfigItem]] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/locations/{{zone}}/clusters/{{name}} + """ + identityServiceConfig: Optional[List[IdentityServiceConfigItem]] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[List[IpAllocationPolicyItem]] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint of the set of labels for this cluster. + """ + location: Optional[str] = None + """ + The location (region or zone) in which the cluster + master will be created, as well as the default node location. If you specify a + zone (such as us-central1-a), the cluster will be a zonal cluster with a + single cluster master. If you specify a region (such as us-west1), the + cluster will be a regional cluster with multiple masters spread across zones in + the region, and with default node locations in those zones as well + """ + loggingConfig: Optional[List[LoggingConfigItem]] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[List[MaintenancePolicyItem]] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[List[MasterAuthItemModel]] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[ + List[MasterAuthorizedNetworksConfigItem] + ] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + masterVersion: Optional[str] = None + """ + The current version of the master in the cluster. This may + be different than the min_master_version set in the config if the master + has been updated by GKE. + """ + meshCertificates: Optional[List[MeshCertificate]] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[List[MonitoringConfigItem]] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[List[NetworkPolicyItem]] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[List[NodeConfigItemModel]] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePool: Optional[List[NodePoolItem]] = None + """ + List of node pools associated with this cluster. + See google_container_node_pool for schema. + Warning: node pools defined inside a cluster can't be changed (or added/removed) after + cluster creation without deleting and recreating the entire cluster. Unless you absolutely need the ability + to say "these are the only node pools associated with this cluster", use the + google_container_node_pool resource instead of this property. + """ + nodePoolAutoConfig: Optional[List[NodePoolAutoConfigItem]] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[List[NodePoolDefault]] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[List[NotificationConfigItem]] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + operation: Optional[str] = None + podAutoscaling: Optional[List[PodAutoscalingItem]] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[List[PrivateClusterConfigItemModel]] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[List[RbacBindingConfigItem]] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[List[ReleaseChannelItem]] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[List[ResourceUsageExportConfigItem]] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[List[SecretManagerConfigItem]] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[List[SecurityPostureConfigItem]] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The server-defined URL for the resource. + """ + serviceExternalIpsConfig: Optional[List[ServiceExternalIpsConfigItem]] = None + """ + Structure is documented below. + """ + servicesIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes services in this + cluster, in CIDR + notation (e.g. 1.2.3.4/29). Service addresses are typically put in the last + /16 from the container CIDR. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + tpuIpv4CidrBlock: Optional[str] = None + """ + The IP address range of the Cloud TPUs in this cluster, in + CIDR + notation (e.g. 1.2.3.4/29). + """ + userManagedKeysConfig: Optional[List[UserManagedKeysConfigItem]] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[List[VerticalPodAutoscalingItem]] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[List[WorkloadIdentityConfigItem]] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Cluster(BaseModel): + apiVersion: Optional[Literal['container.gcp.upbound.io/v1beta1']] = ( + 'container.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Cluster']] = 'Cluster' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ClusterSpec defines the desired state of Cluster + """ + status: Optional[Status] = None + """ + ClusterStatus defines the observed state of Cluster. + """ + + +class ClusterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Cluster] + """ + List of clusters. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/container/cluster/v1beta2.py b/schemas/python/models/io/upbound/gcp/container/cluster/v1beta2.py new file mode 100644 index 000000000..f0c3ef09a --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/container/cluster/v1beta2.py @@ -0,0 +1,3992 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_upbound_io_v1beta2_cluster.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class CloudrunConfig(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + loadBalancerType: Optional[str] = None + """ + The load balancer type of CloudRun ingress service. It is external load balancer by default. + Set load_balancer_type=LOAD_BALANCER_TYPE_INTERNAL to configure it as internal load balancer. + """ + + +class ConfigConnectorConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class DnsCacheConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcePersistentDiskCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcpFilestoreCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcsFuseCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GkeBackupAgentConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class HorizontalPodAutoscaling(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class HttpLoadBalancing(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class LustreCsiDriverConfig(BaseModel): + enableLegacyLustrePort: Optional[bool] = None + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class NetworkPolicyConfig(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class ParallelstoreCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayClusterLoggingConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayClusterMonitoringConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayOperatorConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + rayClusterLoggingConfig: Optional[RayClusterLoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + rayClusterMonitoringConfig: Optional[RayClusterMonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + + +class StatefulHaConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class AddonsConfig(BaseModel): + cloudrunConfig: Optional[CloudrunConfig] = None + """ + . Structure is documented below. + """ + configConnectorConfig: Optional[ConfigConnectorConfig] = None + """ + . + The status of the ConfigConnector addon. It is disabled by default; Set enabled = true to enable. + """ + dnsCacheConfig: Optional[DnsCacheConfig] = None + """ + . + The status of the NodeLocal DNSCache addon. It is disabled by default. + Set enabled = true to enable. + """ + gcePersistentDiskCsiDriverConfig: Optional[GcePersistentDiskCsiDriverConfig] = None + """ + . + Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Set enabled = true to enable. + """ + gcpFilestoreCsiDriverConfig: Optional[GcpFilestoreCsiDriverConfig] = None + """ + The status of the Filestore CSI driver addon, + which allows the usage of filestore instance as volumes. + It is disabled by default; set enabled = true to enable. + """ + gcsFuseCsiDriverConfig: Optional[GcsFuseCsiDriverConfig] = None + """ + The status of the GCSFuse CSI driver addon, + which allows the usage of a gcs bucket as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is enabled by default for Autopilot clusters with version 1.24 or later; set enabled = true to enable it explicitly. + See Enable the Cloud Storage FUSE CSI driver for more information. + """ + gkeBackupAgentConfig: Optional[GkeBackupAgentConfig] = None + """ + . + The status of the Backup for GKE agent addon. It is disabled by default; Set enabled = true to enable. + """ + horizontalPodAutoscaling: Optional[HorizontalPodAutoscaling] = None + """ + The status of the Horizontal Pod Autoscaling + addon, which increases or decreases the number of replica pods a replication controller + has based on the resource usage of the existing pods. + It is enabled by default; + set disabled = true to disable. + """ + httpLoadBalancing: Optional[HttpLoadBalancing] = None + """ + The status of the HTTP (L7) load balancing + controller addon, which makes it easy to set up HTTP load balancers for services in a + cluster. It is enabled by default; set disabled = true to disable. + """ + lustreCsiDriverConfig: Optional[LustreCsiDriverConfig] = None + """ + The status of the Lustre CSI driver addon, + which allows the usage of a Lustre instances as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is disabled by default for Autopilot clusters; set enabled = true to enable. + Lustre CSI Driver Config has optional subfield + enable_legacy_lustre_port which allows the Lustre CSI driver to initialize LNet (the virtual networklayer for Lustre kernel module) using port 6988. + This flag is required to workaround a port conflict with the gke-metadata-server on GKE nodes. + See Enable Lustre CSI driver for more information. + """ + networkPolicyConfig: Optional[NetworkPolicyConfig] = None + """ + Whether we should enable the network policy addon + for the master. This must be enabled in order to enable network policy for the nodes. + To enable this, you must also define a network_policy block, + otherwise nothing will happen. + It can only be disabled if the nodes already do not have network policies enabled. + Defaults to disabled; set disabled = false to enable. + """ + parallelstoreCsiDriverConfig: Optional[ParallelstoreCsiDriverConfig] = None + """ + The status of the Parallelstore CSI driver addon, + which allows the usage of a Parallelstore instances as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is enabled by default for Autopilot clusters with version 1.29 or later; set enabled = true to enable it explicitly. + See Enable the Parallelstore CSI driver for more information. + """ + rayOperatorConfig: Optional[List[RayOperatorConfigItem]] = None + """ + . The status of the Ray Operator + addon. + It is disabled by default. Set enabled = true to enable. The minimum + cluster version to enable Ray is 1.30.0-gke.1747000. + """ + statefulHaConfig: Optional[StatefulHaConfig] = None + """ + . + The status of the Stateful HA addon, which provides automatic configurable failover for stateful applications. + It is disabled by default for Standard clusters. Set enabled = true to enable. + """ + + +class AnonymousAuthenticationConfig(BaseModel): + mode: Optional[str] = None + """ + Sets or removes authentication restrictions. Available options include LIMITED and ENABLED. + """ + + +class AuthenticatorGroupsConfig(BaseModel): + securityGroup: Optional[str] = None + """ + The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com. + """ + + +class BinaryAuthorization(BaseModel): + enabled: Optional[bool] = None + """ + (DEPRECATED) Enable Binary Authorization for this cluster. Deprecated in favor of evaluation_mode. + """ + evaluationMode: Optional[str] = None + """ + Mode of operation for Binary Authorization policy evaluation. Valid values are DISABLED + and PROJECT_SINGLETON_POLICY_ENFORCE. + """ + + +class Management(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + Defines if the instance has integrity monitoring enabled. + """ + enableSecureBoot: Optional[bool] = None + """ + Defines if the instance has Secure Boot enabled. + """ + + +class StandardRolloutPolicy(BaseModel): + batchNodeCount: Optional[float] = None + """ + Number of blue nodes to drain in a batch. Only one of the batch_percentage or batch_node_count can be specified. + """ + batchPercentage: Optional[float] = None + """ + : Percentage of the bool pool nodes to drain in a batch. The range of this field should be (0.0, 1.0). Only one of the batch_percentage or batch_node_count can be specified. + """ + batchSoakDuration: Optional[str] = None + """ + Soak time after each batch gets drained. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".`. + """ + + +class BlueGreenSettings(BaseModel): + nodePoolSoakDuration: Optional[str] = None + """ + Time needed after draining entire blue pool. After this period, blue pool will be cleaned up. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s". + """ + standardRolloutPolicy: Optional[StandardRolloutPolicy] = None + """ + green upgrade. To be specified when strategy is set to BLUE_GREEN. Structure is documented below. + """ + + +class UpgradeSettings(BaseModel): + blueGreenSettings: Optional[BlueGreenSettings] = None + """ + Settings for blue-green upgrade strategy. To be specified when strategy is set to BLUE_GREEN. Structure is documented below. + """ + maxSurge: Optional[float] = None + """ + The maximum number of nodes that can be created beyond the current size of the node pool during the upgrade process. To be used when strategy is set to SURGE. Default is 0. + """ + maxUnavailable: Optional[float] = None + """ + The maximum number of nodes that can be simultaneously unavailable during the upgrade process. To be used when strategy is set to SURGE. Default is 0. + """ + strategy: Optional[str] = None + """ + Strategy used for node pool update. Strategy can only be one of BLUE_GREEN or SURGE. The default is value is SURGE. + """ + + +class AutoProvisioningDefaults(BaseModel): + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + diskSize: Optional[float] = None + """ + Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. Defaults to 100 + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + management: Optional[Management] = None + """ + NodeManagement configuration for this NodePool. Structure is documented below. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specifies the upgrade settings for NAP created node pools. Structure is documented below. + """ + + +class ResourceLimit(BaseModel): + maximum: Optional[float] = None + """ + Maximum amount of the resource in the cluster. + """ + minimum: Optional[float] = None + """ + Minimum amount of the resource in the cluster. + """ + resourceType: Optional[str] = None + """ + The type of the resource. For example, cpu and + memory. See the guide to using Node Auto-Provisioning + for a list of types. + """ + + +class ClusterAutoscaling(BaseModel): + autoProvisioningDefaults: Optional[AutoProvisioningDefaults] = None + """ + Contains defaults for a node pool created by NAP. A subset of fields also apply to + GKE Autopilot clusters. + Structure is documented below. + """ + autoProvisioningLocations: Optional[List[str]] = None + """ + The list of Google Compute Engine + zones in which the + NodePool's nodes can be created by NAP. + """ + autoscalingProfile: Optional[str] = None + """ + Configuration + options for the Autoscaling profile + feature, which lets you choose whether the cluster autoscaler should optimize for resource utilization or resource availability + when deciding to remove nodes from a cluster. Can be BALANCED or OPTIMIZE_UTILIZATION. Defaults to BALANCED. + """ + enabled: Optional[bool] = None + """ + Whether node auto-provisioning is enabled. Must be supplied for GKE Standard clusters, true is implied + for autopilot clusters. Resource limits for cpu and memory must be defined to enable node auto-provisioning for GKE Standard. + """ + resourceLimits: Optional[List[ResourceLimit]] = None + """ + Global constraints for machine resources in the + cluster. Configuring the cpu and memory types is required if node + auto-provisioning is enabled. These limits will apply to node pool autoscaling + in addition to node auto-provisioning. Structure is documented below. + """ + + +class ConfidentialNodes(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class DnsEndpointConfig(BaseModel): + allowExternalTraffic: Optional[bool] = None + """ + Controls whether user traffic is allowed over this endpoint. Note that GCP-managed services may still use the endpoint even if this is false. + """ + endpoint: Optional[str] = None + """ + (Output) The cluster's DNS endpoint. + """ + + +class IpEndpointsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Controls whether to allow direct IP access. Defaults to true. + """ + + +class ControlPlaneEndpointsConfig(BaseModel): + dnsEndpointConfig: Optional[DnsEndpointConfig] = None + """ + DNS endpoint configuration. + """ + ipEndpointsConfig: Optional[IpEndpointsConfig] = None + """ + IP endpoint configuration. + """ + + +class CostManagementConfig(BaseModel): + enabled: Optional[bool] = None + """ + Whether to enable the cost allocation feature. + """ + + +class DatabaseEncryption(BaseModel): + keyName: Optional[str] = None + """ + the key to use to encrypt/decrypt secrets. See the DatabaseEncryption definition for more information. + """ + state: Optional[str] = None + """ + ENCRYPTED or DECRYPTED + """ + + +class DefaultSnatStatus(BaseModel): + disabled: Optional[bool] = None + """ + Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when defaultSnatStatus is disabled.When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic + """ + + +class DnsConfig(BaseModel): + additiveVpcScopeDnsDomain: Optional[str] = None + """ + This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = "CLOUD_DNS" and cluster_dns_scope = "CLUSTER_SCOPE" must both be set as well. + """ + clusterDns: Optional[str] = None + """ + Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS. + """ + clusterDnsDomain: Optional[str] = None + """ + The suffix used for all cluster service records. + """ + clusterDnsScope: Optional[str] = None + """ + The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED or CLUSTER_SCOPE or VPC_SCOPE. If the cluster_dns field is set to CLOUD_DNS, DNS_SCOPE_UNSPECIFIED and empty/null behave like CLUSTER_SCOPE. + """ + + +class EnableK8SBetaApis(BaseModel): + enabledApis: Optional[List[str]] = None + """ + Enabled Kubernetes Beta APIs. To list a Beta API resource, use the representation {group}/{version}/{resource}. The version must be a Beta version. Note that you cannot disable beta APIs that are already enabled on a cluster without recreating it. See the Configure beta APIs for more information. + """ + + +class EnterpriseConfig(BaseModel): + desiredTier: Optional[str] = None + """ + Sets the tier of the cluster. Available options include STANDARD and ENTERPRISE. + """ + + +class Fleet(BaseModel): + project: Optional[str] = None + """ + The name of the Fleet host project where this cluster will be registered. + """ + + +class GatewayApiConfig(BaseModel): + channel: Optional[str] = None + """ + Which Gateway Api channel should be used. CHANNEL_DISABLED, CHANNEL_EXPERIMENTAL or CHANNEL_STANDARD. + """ + + +class GkeAutoUpgradeConfig(BaseModel): + patchMode: Optional[str] = None + """ + The selected patch mode. + Accepted values are: + """ + + +class IdentityServiceConfig(BaseModel): + enabled: Optional[bool] = None + """ + Whether to enable the Identity Service component. It is disabled by default. Set enabled=true to enable. + """ + + +class AdditionalIpRangesConfigItem(BaseModel): + podIpv4RangeNames: Optional[List[str]] = None + """ + List of secondary ranges names within this subnetwork that can be used for pod IPs. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class AdditionalPodRangesConfig(BaseModel): + podRangeNames: Optional[List[str]] = None + """ + The names of the Pod ranges to add to the cluster. + """ + + +class PodCidrOverprovisionConfig(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class IpAllocationPolicy(BaseModel): + additionalIpRangesConfig: Optional[List[AdditionalIpRangesConfigItem]] = None + """ + The configuration for individual additional subnetworks attached to the cluster. + Structure is documented below. + """ + additionalPodRangesConfig: Optional[AdditionalPodRangesConfig] = None + """ + The configuration for additional pod secondary ranges at + the cluster level. Used for Autopilot clusters and Standard clusters with which control of the + secondary Pod IP address assignment to node pools isn't needed. Structure is documented below. + """ + clusterIpv4CidrBlock: Optional[str] = None + """ + The IP address range for the cluster pod IPs. + Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) + to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) + from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to + pick a specific range to use. + """ + clusterSecondaryRangeName: Optional[str] = None + """ + The name of the existing secondary + range in the cluster's subnetwork to use for pod IP addresses. Alternatively, + cluster_ipv4_cidr_block can be used to automatically create a GKE-managed one. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + servicesIpv4CidrBlock: Optional[str] = None + """ + The IP address range of the services IPs in this cluster. + Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) + to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) + from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to + pick a specific range to use. + """ + servicesSecondaryRangeName: Optional[str] = None + """ + The name of the existing + secondary range in the cluster's subnetwork to use for service ClusterIPs. + Alternatively, services_ipv4_cidr_block can be used to automatically create a + GKE-managed one. + """ + stackType: Optional[str] = None + """ + The IP Stack Type of the cluster. + Default value is IPV4. + Possible values are IPV4 and IPV4_IPV6. + """ + + +class LoggingConfig(BaseModel): + enableComponents: Optional[List[str]] = None + """ + The GKE components exposing logs. Supported values include: + SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. + """ + + +class DailyMaintenanceWindow(BaseModel): + startTime: Optional[str] = None + + +class ExclusionOptions(BaseModel): + scope: Optional[str] = None + """ + Whether or not to enable GKE Auto-Monitoring. Supported values include: ALL, NONE. + """ + + +class MaintenanceExclusionItem(BaseModel): + endTime: Optional[str] = None + exclusionName: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + exclusionOptions: Optional[ExclusionOptions] = None + """ + MaintenanceExclusionOptions provides maintenance exclusion related options. + """ + startTime: Optional[str] = None + + +class RecurringWindow(BaseModel): + endTime: Optional[str] = None + recurrence: Optional[str] = None + startTime: Optional[str] = None + + +class MaintenancePolicy(BaseModel): + dailyMaintenanceWindow: Optional[DailyMaintenanceWindow] = None + """ + structure documented below. + """ + maintenanceExclusion: Optional[List[MaintenanceExclusionItem]] = None + """ + structure documented below + """ + recurringWindow: Optional[RecurringWindow] = None + """ + structure documented below + """ + + +class ClientCertificateConfig(BaseModel): + issueClientCertificate: Optional[bool] = None + + +class MasterAuth(BaseModel): + clientCertificateConfig: Optional[ClientCertificateConfig] = None + """ + Whether client certificate authorization is enabled for this cluster. For example: + """ + + +class CidrBlock(BaseModel): + cidrBlock: Optional[str] = None + """ + External network that can access Kubernetes master through HTTPS. + Must be specified in CIDR notation. + """ + displayName: Optional[str] = None + """ + Field for users to identify CIDR blocks. + """ + + +class MasterAuthorizedNetworksConfig(BaseModel): + cidrBlocks: Optional[List[CidrBlock]] = None + """ + External networks that can access the + Kubernetes cluster master through HTTPS. + """ + gcpPublicCidrsAccessEnabled: Optional[bool] = None + """ + Whether Kubernetes master is + accessible via Google Compute Engine Public IPs. + """ + privateEndpointEnforcementEnabled: Optional[bool] = None + """ + Whether authorized networks is enforced on the private endpoint or not. + """ + + +class MeshCertificates(BaseModel): + enableCertificates: Optional[bool] = None + """ + Controls the issuance of workload mTLS certificates. It is enabled by default. Workload Identity is required, see workload_config. + """ + + +class AdvancedDatapathObservabilityConfig(BaseModel): + enableMetrics: Optional[bool] = None + """ + Whether or not to enable advanced datapath metrics. + """ + enableRelay: Optional[bool] = None + """ + Whether or not Relay is enabled. + """ + + +class AutoMonitoringConfig(BaseModel): + scope: Optional[str] = None + """ + Whether or not to enable GKE Auto-Monitoring. Supported values include: ALL, NONE. + """ + + +class ManagedPrometheus(BaseModel): + autoMonitoringConfig: Optional[AutoMonitoringConfig] = None + """ + Configuration options for GKE Auto-Monitoring. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class MonitoringConfig(BaseModel): + advancedDatapathObservabilityConfig: Optional[ + AdvancedDatapathObservabilityConfig + ] = None + """ + Configuration for Advanced Datapath Monitoring. Structure is documented below. + """ + enableComponents: Optional[List[str]] = None + """ + The GKE components exposing metrics. Supported values include: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR, DCGM and JOBSET. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. JOBSET is only supported in GKE 1.32.1-gke.1357001 and above. + """ + managedPrometheus: Optional[ManagedPrometheus] = None + """ + Configuration for Managed Service for Prometheus. Structure is documented below. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + Specifies the total network bandwidth tier for NodePools in the cluster. + """ + + +class NetworkPolicy(BaseModel): + enabled: Optional[bool] = None + """ + Whether network policy is enabled on the cluster. + """ + provider: Optional[str] = None + """ + The selected network policy provider. Defaults to PROVIDER_UNSPECIFIED. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + performanceMonitoringUnit: Optional[str] = None + """ + Defines the performance monitoring unit PMU level. Valid values are ARCHITECTURAL, STANDARD, or ENHANCED. Defaults to off. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + """ + + +class ConfidentialNodesModel(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcpSecretManagerCertificateConfig(BaseModel): + secretUri: Optional[str] = None + + +class CertificateAuthorityDomainConfigItem(BaseModel): + fqdns: Optional[List[str]] = None + gcpSecretManagerCertificateConfig: Optional[GcpSecretManagerCertificateConfig] = ( + None + ) + + +class PrivateRegistryAccessConfig(BaseModel): + certificateAuthorityDomainConfig: Optional[ + List[CertificateAuthorityDomainConfigItem] + ] = None + """ + List of configuration objects for CA and domains. Each object identifies a certificate and its assigned domains. See how to configure for private container registries for more detail. Example: + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class ContainerdConfig(BaseModel): + privateRegistryAccessConfig: Optional[PrivateRegistryAccessConfig] = None + """ + Configuration for private container registries. There are two fields in this config: + """ + + +class EphemeralStorageLocalSsdConfig(BaseModel): + dataCacheCount: Optional[float] = None + """ + Number of raw-block local NVMe SSD disks to be attached to the node utilized for GKE Data Cache. If zero, then GKE Data Cache will not be enabled in the nodes. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + + +class FastSocket(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcfsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GpuDriverInstallationConfig(BaseModel): + gpuDriverVersion: Optional[str] = None + """ + Mode for how the GPU driver is installed. + Accepted values are: + """ + + +class GpuSharingConfig(BaseModel): + gpuSharingStrategy: Optional[str] = None + """ + The type of GPU sharing strategy to enable on the GPU node. + Accepted values are: + """ + maxSharedClientsPerGpu: Optional[float] = None + """ + The maximum number of containers that can share a GPU. + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + gpuDriverInstallationConfig: Optional[GpuDriverInstallationConfig] = None + """ + Configuration for auto installation of GPU driver. Structure is documented below. + """ + gpuPartitionSize: Optional[str] = None + """ + Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide. + """ + gpuSharingConfig: Optional[GpuSharingConfig] = None + """ + Configuration for GPU sharing. Structure is documented below. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class Gvnic(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class HostMaintenancePolicy(BaseModel): + maintenanceInterval: Optional[str] = None + + +class KubeletConfig(BaseModel): + allowedUnsafeSysctls: Optional[List[str]] = None + """ + Defines a comma-separated allowlist of unsafe sysctls or sysctl patterns which can be set on the Pods. The allowed sysctl groups are kernel.shm*, kernel.msg*, kernel.sem, fs.mqueue.*, and net.*. + """ + containerLogMaxFiles: Optional[float] = None + """ + Defines the maximum number of container log files that can be present for a container. The integer must be between 2 and 10, inclusive. + """ + containerLogMaxSize: Optional[str] = None + """ + Defines the maximum size of the + container log file before it is rotated. Specified as a positive number and a + unit suffix, such as "100Ki", "10Mi". Valid units are "Ki", "Mi", "Gi". + The value must be between "10Mi" and "500Mi", inclusive. And the total container log size + (container_log_max_size * container_log_max_files) cannot exceed 1% of the total storage of the node. + """ + cpuCfsQuota: Optional[bool] = None + """ + If true, enables CPU CFS quota enforcement for + containers that specify CPU limits. + """ + cpuCfsQuotaPeriod: Optional[str] = None + """ + The CPU CFS quota period value. Specified + as a sequence of decimal numbers, each with optional fraction and a unit suffix, + such as "300ms". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", + "h". The value must be a positive duration. + """ + cpuManagerPolicy: Optional[str] = None + """ + The CPU management policy on the node. See + K8S CPU Management Policies. + One of "none" or "static". If unset (or set to the empty string ""), the API will treat the field as if set to "none". + Prior to the 6.4.0 this field was marked as required. The workaround for the required field + is setting the empty string "", which will function identically to not setting this field. + """ + imageGcHighThresholdPercent: Optional[float] = None + """ + Defines the percent of disk usage after which image garbage collection is always run. The integer must be between 10 and 85, inclusive. + """ + imageGcLowThresholdPercent: Optional[float] = None + """ + Defines the percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. The integer must be between 10 and 85, inclusive. + """ + imageMaximumGcAge: Optional[str] = None + """ + Defines the maximum age an image can be unused before it is garbage collected. Specified as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300s", "1.5m", and "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". The value must be a positive duration. + """ + imageMinimumGcAge: Optional[str] = None + """ + Defines the minimum age for an unused image before it is garbage collected. Specified as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300s", "1.5m". The value cannot be greater than "2m". + """ + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + podPidsLimit: Optional[float] = None + """ + Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. + """ + + +class HugepagesConfig(BaseModel): + hugepageSize1G: Optional[float] = None + """ + Amount of 1G hugepages. + """ + hugepageSize2M: Optional[float] = None + """ + Amount of 2M hugepages. + """ + + +class LinuxNodeConfig(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[HugepagesConfig] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class LocalNvmeSsdBlockConfig(BaseModel): + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + + +class ReservationAffinity(BaseModel): + consumeReservationType: Optional[str] = None + """ + The type of reservation consumption + Accepted values are: + """ + key: Optional[str] = None + """ + Key for taint. + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SecondaryBootDisk(BaseModel): + diskImage: Optional[str] = None + """ + Path to disk image to create the secondary boot disk from. After using the gke-disk-image-builder, this argument should be global/images/DISK_IMAGE_NAME. + """ + mode: Optional[str] = None + """ + How to expose the node metadata to the workload running on the node. + Accepted values are: + """ + + +class ServiceAccountRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NodeAffinityItem(BaseModel): + key: Optional[str] = None + """ + Key for taint. + """ + operator: Optional[str] = None + """ + Specifies affinity or anti-affinity. Accepted values are "IN" or "NOT_IN" + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SoleTenantConfig(BaseModel): + nodeAffinity: Optional[List[NodeAffinityItem]] = None + + +class TaintItem(BaseModel): + effect: Optional[str] = None + """ + Effect for taint. Accepted values are NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE. + """ + key: Optional[str] = None + """ + Key for taint. + """ + value: Optional[str] = None + """ + Value for taint. + """ + + +class WindowsNodeConfig(BaseModel): + osversion: Optional[str] = None + + +class WorkloadMetadataConfig(BaseModel): + mode: Optional[str] = None + """ + How to expose the node metadata to the workload running on the node. + Accepted values are: + """ + + +class NodeConfig(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[ConfidentialNodesModel] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[FastSocket] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + Parameters for the Google Container Filesystem (GCFS). + If unspecified, GCFS will not be enabled on the node pool. When enabling this feature you must specify image_type = "COS_CONTAINERD" and node_version from GKE versions 1.19 or later to use it. + For GKE versions 1.19, 1.20, and 1.21, the recommended minimum node_version would be 1.19.15-gke.1300, 1.20.11-gke.1300, and 1.21.5-gke.1300 respectively. + A machine_type that has more than 16 GiB of memory is also recommended. + GCFS must be enabled in order to use image streaming. + Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[Gvnic] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[KubeletConfig] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[LinuxNodeConfig] = None + """ + Parameters that can be configured on Linux nodes. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + wide default value. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCP labels (key/value pairs) to be applied to each node. Refer here + for how these labels are applied to clusters, node pools and nodes. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + serviceAccountRef: Optional[ServiceAccountRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccount. + """ + serviceAccountSelector: Optional[ServiceAccountSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccount. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[SoleTenantConfig] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class LinuxNodeConfigModel(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class NetworkTags(BaseModel): + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + + +class NodeKubeletConfig(BaseModel): + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + + +class NodePoolAutoConfig(BaseModel): + linuxNodeConfig: Optional[LinuxNodeConfigModel] = None + """ + Linux system configuration for the cluster's automatically provisioned node pools. Only cgroup_mode field is supported in node_pool_auto_config. Structure is documented below. + """ + networkTags: Optional[NetworkTags] = None + """ + The network tag config for the cluster's automatically provisioned node pools. Structure is documented below. + """ + nodeKubeletConfig: Optional[NodeKubeletConfig] = None + """ + Kubelet configuration for Autopilot clusters. Currently, only insecure_kubelet_readonly_port_enabled is supported here. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + + +class NodeConfigDefaults(BaseModel): + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable image streaming across all the node pools within the cluster. Structure is documented below. + """ + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + loggingVariant: Optional[str] = None + """ + The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + + +class NodePoolDefaults(BaseModel): + nodeConfigDefaults: Optional[NodeConfigDefaults] = None + """ + Subset of NodeConfig message that has defaults. + """ + + +class Filter(BaseModel): + eventType: Optional[List[str]] = None + """ + Can be used to filter what notifications are sent. Accepted values are UPGRADE_AVAILABLE_EVENT, UPGRADE_EVENT, SECURITY_BULLETIN_EVENT and UPGRADE_INFO_EVENT. See Filtering notifications for more details. + """ + + +class Pubsub(BaseModel): + enabled: Optional[bool] = None + """ + Whether or not the notification config is enabled + """ + filter: Optional[Filter] = None + """ + Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Structure is documented below. + """ + topic: Optional[str] = None + """ + The pubsub topic to push upgrade notifications to. Must be in the same project as the cluster. Must be in the format: projects/{project}/topics/{topic}. + """ + + +class NotificationConfig(BaseModel): + pubsub: Optional[Pubsub] = None + """ + The pubsub config for the cluster's upgrade notifications. + """ + + +class PodAutoscaling(BaseModel): + hpaProfile: Optional[str] = None + """ + Enable the Horizontal Pod Autoscaling profile for this cluster. + Acceptable values are: + """ + + +class MasterGlobalAccessConfig(BaseModel): + enabled: Optional[bool] = None + """ + Whether the cluster master is accessible globally or + not. + """ + + +class PrivateEndpointSubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PrivateEndpointSubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PrivateClusterConfig(BaseModel): + enablePrivateEndpoint: Optional[bool] = None + """ + When true, the cluster's private + endpoint is used as the cluster endpoint and access through the public endpoint + is disabled. When false, either endpoint can be used. This field only applies + to private clusters, when enable_private_nodes is true. + """ + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + masterGlobalAccessConfig: Optional[MasterGlobalAccessConfig] = None + """ + Controls cluster master global + access settings. Structure is documented below. + """ + masterIpv4CidrBlock: Optional[str] = None + """ + The IP range in CIDR notation to use for + the hosted master network. This range will be used for assigning private IP + addresses to the cluster master(s) and the ILB VIP. This range must not overlap + with any other ranges in use within the cluster's network, and it must be a /28 + subnet. See Private Cluster Limitations + for more details. This field only applies to private clusters, when + enable_private_nodes is true. + """ + privateEndpointSubnetwork: Optional[str] = None + """ + Subnetwork in cluster's network where master's endpoint will be provisioned. + """ + privateEndpointSubnetworkRef: Optional[PrivateEndpointSubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate privateEndpointSubnetwork. + """ + privateEndpointSubnetworkSelector: Optional[PrivateEndpointSubnetworkSelector] = ( + None + ) + """ + Selector for a Subnetwork in compute to populate privateEndpointSubnetwork. + """ + + +class RbacBindingConfig(BaseModel): + enableInsecureBindingSystemAuthenticated: Optional[bool] = None + """ + Setting this to true will allow any ClusterRoleBinding and RoleBinding with subjects system:authenticated. + """ + enableInsecureBindingSystemUnauthenticated: Optional[bool] = None + """ + Setting this to true will allow any ClusterRoleBinding and RoleBinding with subjects system:anonymous or system:unauthenticated. + """ + + +class ReleaseChannel(BaseModel): + channel: Optional[str] = None + """ + The selected release channel. + Accepted values are: + """ + + +class BigqueryDestination(BaseModel): + datasetId: Optional[str] = None + """ + The ID of a BigQuery Dataset. For Example: + """ + + +class ResourceUsageExportConfig(BaseModel): + bigqueryDestination: Optional[BigqueryDestination] = None + """ + Parameters for using BigQuery as the destination of resource usage export. + """ + enableNetworkEgressMetering: Optional[bool] = None + """ + Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created + in the cluster to meter network egress traffic. + """ + enableResourceConsumptionMetering: Optional[bool] = None + """ + Whether to enable resource + consumption metering on this cluster. When enabled, a table will be created in + the resource export BigQuery dataset to store resource consumption data. The + resulting table can be joined with the resource usage table or with BigQuery + billing export. Defaults to true. + """ + + +class SecretManagerConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enable the Secret Manager add-on for this cluster. + """ + + +class SecurityPostureConfig(BaseModel): + mode: Optional[str] = None + """ + Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include DISABLED, BASIC, and ENTERPRISE. + """ + vulnerabilityMode: Optional[str] = None + """ + Sets the mode of the Kubernetes security posture API's workload vulnerability scanning. Available options include VULNERABILITY_DISABLED, VULNERABILITY_BASIC and VULNERABILITY_ENTERPRISE. + """ + + +class ServiceExternalIpsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Controls whether external ips specified by a service will be allowed. It is enabled by default. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UserManagedKeysConfig(BaseModel): + aggregationCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the aggreation CA in this cluster. + """ + clusterCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the cluster CA in this cluster. + """ + controlPlaneDiskEncryptionKey: Optional[str] = None + """ + The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control plane nodes. + """ + etcdApiCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the etcd API CA in this cluster. + """ + etcdPeerCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the etcd peer CA in this cluster. + """ + gkeopsEtcdBackupEncryptionKey: Optional[str] = None + """ + Resource path of the Cloud KMS cryptoKey to use for encryption of internal etcd backups. + """ + serviceAccountSigningKeys: Optional[List[str]] = None + """ + The Cloud KMS cryptoKeyVersions to use for signing service account JWTs issued by this cluster. + """ + serviceAccountVerificationKeys: Optional[List[str]] = None + """ + The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs issued by this cluster. + """ + + +class VerticalPodAutoscaling(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class WorkloadIdentityConfig(BaseModel): + workloadPool: Optional[str] = None + """ + The workload pool to attach all Kubernetes service accounts to. + """ + + +class ForProvider(BaseModel): + addonsConfig: Optional[AddonsConfig] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[AnonymousAuthenticationConfig] = None + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[AuthenticatorGroupsConfig] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[BinaryAuthorization] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[ClusterAutoscaling] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[ConfidentialNodes] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[ControlPlaneEndpointsConfig] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[CostManagementConfig] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[DatabaseEncryption] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[DefaultSnatStatus] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[DnsConfig] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[EnableK8SBetaApis] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + enterpriseConfig: Optional[EnterpriseConfig] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[Fleet] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[GatewayApiConfig] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[GkeAutoUpgradeConfig] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + identityServiceConfig: Optional[IdentityServiceConfig] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[IpAllocationPolicy] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + location: str + """ + The location (region or zone) in which the cluster + master will be created, as well as the default node location. If you specify a + zone (such as us-central1-a), the cluster will be a zonal cluster with a + single cluster master. If you specify a region (such as us-west1), the + cluster will be a regional cluster with multiple masters spread across zones in + the region, and with default node locations in those zones as well + """ + loggingConfig: Optional[LoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[MaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[MasterAuth] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[MasterAuthorizedNetworksConfig] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + meshCertificates: Optional[MeshCertificates] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[MonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[NetworkPolicy] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePoolAutoConfig: Optional[NodePoolAutoConfig] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[NodePoolDefaults] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[NotificationConfig] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + podAutoscaling: Optional[PodAutoscaling] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[PrivateClusterConfig] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[RbacBindingConfig] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[ReleaseChannel] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[ResourceUsageExportConfig] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[SecretManagerConfig] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[SecurityPostureConfig] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + serviceExternalIpsConfig: Optional[ServiceExternalIpsConfig] = None + """ + Structure is documented below. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + userManagedKeysConfig: Optional[UserManagedKeysConfig] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[VerticalPodAutoscaling] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[WorkloadIdentityConfig] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class ConfidentialNodesModel1(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class ConfidentialNodesModel2(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class LinuxNodeConfigModel1(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[HugepagesConfig] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class LinuxNodeConfigModel2(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class InitProvider(BaseModel): + addonsConfig: Optional[AddonsConfig] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[AnonymousAuthenticationConfig] = None + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[AuthenticatorGroupsConfig] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[BinaryAuthorization] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[ClusterAutoscaling] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[ConfidentialNodesModel1] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[ControlPlaneEndpointsConfig] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[CostManagementConfig] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[DatabaseEncryption] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[DefaultSnatStatus] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[DnsConfig] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[EnableK8SBetaApis] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + enterpriseConfig: Optional[EnterpriseConfig] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[Fleet] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[GatewayApiConfig] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[GkeAutoUpgradeConfig] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + identityServiceConfig: Optional[IdentityServiceConfig] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[IpAllocationPolicy] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + loggingConfig: Optional[LoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[MaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[MasterAuth] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[MasterAuthorizedNetworksConfig] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + meshCertificates: Optional[MeshCertificates] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[MonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[NetworkPolicy] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePoolAutoConfig: Optional[NodePoolAutoConfig] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[NodePoolDefaults] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[NotificationConfig] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + podAutoscaling: Optional[PodAutoscaling] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[PrivateClusterConfig] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[RbacBindingConfig] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[ReleaseChannel] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[ResourceUsageExportConfig] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[SecretManagerConfig] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[SecurityPostureConfig] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + serviceExternalIpsConfig: Optional[ServiceExternalIpsConfig] = None + """ + Structure is documented below. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + userManagedKeysConfig: Optional[UserManagedKeysConfig] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[VerticalPodAutoscaling] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[WorkloadIdentityConfig] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UpgradeOption(BaseModel): + autoUpgradeStartTime: Optional[str] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + + +class ManagementModel(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + upgradeOptions: Optional[List[UpgradeOption]] = None + """ + Specifies the Auto Upgrade knobs for the node pool. + """ + + +class ConfidentialNodesModel3(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class EnterpriseConfigModel(BaseModel): + clusterTier: Optional[str] = None + """ + The effective tier of the cluster. + """ + desiredTier: Optional[str] = None + """ + Sets the tier of the cluster. Available options include STANDARD and ENTERPRISE. + """ + + +class FleetModel(BaseModel): + membership: Optional[str] = None + """ + The resource name of the fleet Membership resource associated to this cluster with format //gkehub.googleapis.com/projects/{{project}}/locations/{{location}}/memberships/{{name}}. See the official doc for fleet management. + """ + membershipId: Optional[str] = None + """ + The short name of the fleet membership, extracted from fleet.0.membership. You can use this field to configure membership_id under google_gkehub_feature_membership. + """ + membershipLocation: Optional[str] = None + """ + The location of the fleet membership, extracted from fleet.0.membership. You can use this field to configure membership_location under google_gkehub_feature_membership. + """ + preRegistered: Optional[bool] = None + project: Optional[str] = None + """ + The name of the Fleet host project where this cluster will be registered. + """ + + +class DailyMaintenanceWindowModel(BaseModel): + duration: Optional[str] = None + """ + Duration of the time window, automatically chosen to be + smallest possible in the given scenario. + Duration will be in RFC3339 format "PTnHnMnS". + """ + startTime: Optional[str] = None + + +class MasterAuthModel(BaseModel): + clientCertificate: Optional[str] = None + """ + Base64 encoded public certificate + used by clients to authenticate to the cluster endpoint. + """ + clientCertificateConfig: Optional[ClientCertificateConfig] = None + """ + Whether client certificate authorization is enabled for this cluster. For example: + """ + clusterCaCertificate: Optional[str] = None + """ + Base64 encoded public certificate + that is the root certificate of the cluster. + """ + + +class ConfidentialNodesModel4(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class EffectiveTaint(BaseModel): + effect: Optional[str] = None + """ + Effect for taint. Accepted values are NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE. + """ + key: Optional[str] = None + """ + Key for taint. + """ + value: Optional[str] = None + """ + Value for taint. + """ + + +class LinuxNodeConfigModel3(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[HugepagesConfig] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class NodeConfigModel(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[ConfidentialNodesModel4] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + effectiveTaints: Optional[List[EffectiveTaint]] = None + """ + List of kubernetes taints applied to each node. Structure is documented above. + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[FastSocket] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + Parameters for the Google Container Filesystem (GCFS). + If unspecified, GCFS will not be enabled on the node pool. When enabling this feature you must specify image_type = "COS_CONTAINERD" and node_version from GKE versions 1.19 or later to use it. + For GKE versions 1.19, 1.20, and 1.21, the recommended minimum node_version would be 1.19.15-gke.1300, 1.20.11-gke.1300, and 1.21.5-gke.1300 respectively. + A machine_type that has more than 16 GiB of memory is also recommended. + GCFS must be enabled in order to use image streaming. + Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[Gvnic] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[KubeletConfig] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[LinuxNodeConfigModel3] = None + """ + Parameters that can be configured on Linux nodes. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + wide default value. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCP labels (key/value pairs) to be applied to each node. Refer here + for how these labels are applied to clusters, node pools and nodes. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[SoleTenantConfig] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class Autoscaling(BaseModel): + locationPolicy: Optional[str] = None + maxNodeCount: Optional[float] = None + minNodeCount: Optional[float] = None + totalMaxNodeCount: Optional[float] = None + totalMinNodeCount: Optional[float] = None + + +class ManagementModel1(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + + +class AdditionalNodeNetworkConfig(BaseModel): + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class AdditionalPodNetworkConfig(BaseModel): + maxPodsPerNode: Optional[float] = None + secondaryPodRange: Optional[str] = None + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class NetworkConfig(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + createPodRange: Optional[bool] = None + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + podIpv4CidrBlock: Optional[str] = None + podRange: Optional[str] = None + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class NodeConfigModel1(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[ConfidentialNodesModel4] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + effectiveTaints: Optional[List[EffectiveTaint]] = None + """ + List of kubernetes taints applied to each node. Structure is documented above. + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[FastSocket] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable image streaming across all the node pools within the cluster. Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[Gvnic] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[KubeletConfig] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[LinuxNodeConfigModel3] = None + """ + Linux system configuration for the cluster's automatically provisioned node pools. Only cgroup_mode field is supported in node_pool_auto_config. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[SoleTenantConfig] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class PlacementPolicy(BaseModel): + policyName: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + tpuTopology: Optional[str] = None + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class QueuedProvisioning(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class NodePoolItem(BaseModel): + autoscaling: Optional[Autoscaling] = None + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + instanceGroupUrls: Optional[List[str]] = None + managedInstanceGroupUrls: Optional[List[str]] = None + management: Optional[ManagementModel1] = None + """ + NodeManagement configuration for this NodePool. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + name: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + namePrefix: Optional[str] = None + networkConfig: Optional[NetworkConfig] = None + nodeConfig: Optional[NodeConfigModel1] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeCount: Optional[float] = None + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + placementPolicy: Optional[PlacementPolicy] = None + queuedProvisioning: Optional[QueuedProvisioning] = None + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specifies the upgrade settings for NAP created node pools. Structure is documented below. + """ + version: Optional[str] = None + + +class LinuxNodeConfigModel4(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class PrivateClusterConfigModel(BaseModel): + enablePrivateEndpoint: Optional[bool] = None + """ + When true, the cluster's private + endpoint is used as the cluster endpoint and access through the public endpoint + is disabled. When false, either endpoint can be used. This field only applies + to private clusters, when enable_private_nodes is true. + """ + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + masterGlobalAccessConfig: Optional[MasterGlobalAccessConfig] = None + """ + Controls cluster master global + access settings. Structure is documented below. + """ + masterIpv4CidrBlock: Optional[str] = None + """ + The IP range in CIDR notation to use for + the hosted master network. This range will be used for assigning private IP + addresses to the cluster master(s) and the ILB VIP. This range must not overlap + with any other ranges in use within the cluster's network, and it must be a /28 + subnet. See Private Cluster Limitations + for more details. This field only applies to private clusters, when + enable_private_nodes is true. + """ + peeringName: Optional[str] = None + """ + The name of the peering between this cluster and the Google owned VPC. + """ + privateEndpoint: Optional[str] = None + """ + The internal IP address of this cluster's master endpoint. + """ + privateEndpointSubnetwork: Optional[str] = None + """ + Subnetwork in cluster's network where master's endpoint will be provisioned. + """ + publicEndpoint: Optional[str] = None + """ + The external IP address of this cluster's master endpoint. + """ + + +class AtProvider(BaseModel): + addonsConfig: Optional[AddonsConfig] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[AnonymousAuthenticationConfig] = None + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[AuthenticatorGroupsConfig] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[BinaryAuthorization] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[ClusterAutoscaling] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[ConfidentialNodesModel3] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[ControlPlaneEndpointsConfig] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[CostManagementConfig] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[DatabaseEncryption] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[DefaultSnatStatus] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[DnsConfig] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + effectiveLabels: Optional[Dict[str, str]] = None + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[EnableK8SBetaApis] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + endpoint: Optional[str] = None + """ + The IP address of this cluster's Kubernetes master. + """ + enterpriseConfig: Optional[EnterpriseConfigModel] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[FleetModel] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[GatewayApiConfig] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[GkeAutoUpgradeConfig] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/locations/{{zone}}/clusters/{{name}} + """ + identityServiceConfig: Optional[IdentityServiceConfig] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[IpAllocationPolicy] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint of the set of labels for this cluster. + """ + location: Optional[str] = None + """ + The location (region or zone) in which the cluster + master will be created, as well as the default node location. If you specify a + zone (such as us-central1-a), the cluster will be a zonal cluster with a + single cluster master. If you specify a region (such as us-west1), the + cluster will be a regional cluster with multiple masters spread across zones in + the region, and with default node locations in those zones as well + """ + loggingConfig: Optional[LoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[MaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[MasterAuthModel] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[MasterAuthorizedNetworksConfig] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + masterVersion: Optional[str] = None + """ + The current version of the master in the cluster. This may + be different than the min_master_version set in the config if the master + has been updated by GKE. + """ + meshCertificates: Optional[MeshCertificates] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[MonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[NetworkPolicy] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[NodeConfigModel] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePool: Optional[List[NodePoolItem]] = None + """ + List of node pools associated with this cluster. + See google_container_node_pool for schema. + Warning: node pools defined inside a cluster can't be changed (or added/removed) after + cluster creation without deleting and recreating the entire cluster. Unless you absolutely need the ability + to say "these are the only node pools associated with this cluster", use the + google_container_node_pool resource instead of this property. + """ + nodePoolAutoConfig: Optional[NodePoolAutoConfig] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[NodePoolDefaults] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[NotificationConfig] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + operation: Optional[str] = None + podAutoscaling: Optional[PodAutoscaling] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[PrivateClusterConfigModel] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[RbacBindingConfig] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[ReleaseChannel] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[ResourceUsageExportConfig] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[SecretManagerConfig] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[SecurityPostureConfig] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The server-defined URL for the resource. + """ + serviceExternalIpsConfig: Optional[ServiceExternalIpsConfig] = None + """ + Structure is documented below. + """ + servicesIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes services in this + cluster, in CIDR + notation (e.g. 1.2.3.4/29). Service addresses are typically put in the last + /16 from the container CIDR. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + tpuIpv4CidrBlock: Optional[str] = None + """ + The IP address range of the Cloud TPUs in this cluster, in + CIDR + notation (e.g. 1.2.3.4/29). + """ + userManagedKeysConfig: Optional[UserManagedKeysConfig] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[VerticalPodAutoscaling] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[WorkloadIdentityConfig] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Cluster(BaseModel): + apiVersion: Optional[Literal['container.gcp.upbound.io/v1beta2']] = ( + 'container.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['Cluster']] = 'Cluster' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ClusterSpec defines the desired state of Cluster + """ + status: Optional[Status] = None + """ + ClusterStatus defines the observed state of Cluster. + """ + + +class ClusterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Cluster] + """ + List of clusters. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/container/nodepool/__init__.py b/schemas/python/models/io/upbound/gcp/container/nodepool/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/container/nodepool/v1beta1.py b/schemas/python/models/io/upbound/gcp/container/nodepool/v1beta1.py new file mode 100644 index 000000000..858ef8a26 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/container/nodepool/v1beta1.py @@ -0,0 +1,1065 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_upbound_io_v1beta1_nodepool.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class AutoscalingItem(BaseModel): + locationPolicy: Optional[str] = None + """ + Location policy specifies the algorithm used when + scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. + """ + maxNodeCount: Optional[float] = None + """ + Maximum number of nodes per zone in the NodePool. + Must be >= min_node_count. Cannot be used with total limits. + """ + minNodeCount: Optional[float] = None + """ + Minimum number of nodes per zone in the NodePool. + Must be >=0 and <= max_node_count. Cannot be used with total limits. + """ + totalMaxNodeCount: Optional[float] = None + """ + Total maximum number of nodes in the NodePool. + Must be >= total_min_node_count. Cannot be used with per zone limits. + Total size limits are supported only in 1.24.1+ clusters. + """ + totalMinNodeCount: Optional[float] = None + """ + Total minimum number of nodes in the NodePool. + Must be >=0 and <= total_max_node_count. Cannot be used with per zone limits. + Total size limits are supported only in 1.24.1+ clusters. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ClusterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ClusterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ManagementItem(BaseModel): + autoRepair: Optional[bool] = None + """ + Whether the nodes will be automatically repaired. Enabled by default. + """ + autoUpgrade: Optional[bool] = None + """ + Whether the nodes will be automatically upgraded. Enabled by default. + """ + + +class AdditionalNodeNetworkConfig(BaseModel): + network: Optional[str] = None + """ + Name of the VPC where the additional interface belongs. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class AdditionalPodNetworkConfig(BaseModel): + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + secondaryPodRange: Optional[str] = None + """ + The name of the secondary range on the subnet which provides IP address for this pod range. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class NetworkPerformanceConfigItem(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + Specifies the total network bandwidth tier for the NodePool. Valid values include: "TIER_1" and "TIER_UNSPECIFIED". + """ + + +class PodCidrOverprovisionConfigItem(BaseModel): + disabled: Optional[bool] = None + + +class NetworkConfigItem(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + """ + We specify the additional node networks for this node pool using this list. Each node network corresponds to an additional interface. + Structure is documented below + """ + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + """ + We specify the additional pod networks for this node pool using this list. Each pod network corresponds to an additional alias IP range for the node. + Structure is documented below + """ + createPodRange: Optional[bool] = None + """ + Whether to create a new range for pod IPs in this node pool. Defaults are provided for pod_range and pod_ipv4_cidr_block if they are not specified. + """ + enablePrivateNodes: Optional[bool] = None + """ + Whether nodes have internal IP addresses only. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + podCidrOverprovisionConfig: Optional[List[PodCidrOverprovisionConfigItem]] = None + podIpv4CidrBlock: Optional[str] = None + """ + The IP address range for pod IPs in this node pool. Only applicable if createPodRange is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) to pick a specific range to use. + """ + podRange: Optional[str] = None + """ + The ID of the secondary range for pod IPs. If create_pod_range is true, this ID is used for the new range. If create_pod_range is false, uses an existing secondary range with this ID. + """ + + +class AdvancedMachineFeature(BaseModel): + enableNestedVirtualization: Optional[bool] = None + performanceMonitoringUnit: Optional[str] = None + threadsPerCore: Optional[float] = None + + +class ConfidentialNode(BaseModel): + confidentialInstanceType: Optional[str] = None + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GcpSecretManagerCertificateConfigItem(BaseModel): + secretUri: Optional[str] = None + + +class CertificateAuthorityDomainConfigItem(BaseModel): + fqdns: Optional[List[str]] = None + gcpSecretManagerCertificateConfig: Optional[ + List[GcpSecretManagerCertificateConfigItem] + ] = None + + +class PrivateRegistryAccessConfigItem(BaseModel): + certificateAuthorityDomainConfig: Optional[ + List[CertificateAuthorityDomainConfigItem] + ] = None + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class ContainerdConfigItem(BaseModel): + privateRegistryAccessConfig: Optional[List[PrivateRegistryAccessConfigItem]] = None + + +class EphemeralStorageLocalSsdConfigItem(BaseModel): + dataCacheCount: Optional[float] = None + localSsdCount: Optional[float] = None + + +class FastSocketItem(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GcfsConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GpuDriverInstallationConfigItem(BaseModel): + gpuDriverVersion: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class GpuSharingConfigItem(BaseModel): + gpuSharingStrategy: Optional[str] = None + maxSharedClientsPerGpu: Optional[float] = None + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + gpuDriverInstallationConfig: Optional[List[GpuDriverInstallationConfigItem]] = None + gpuPartitionSize: Optional[str] = None + gpuSharingConfig: Optional[List[GpuSharingConfigItem]] = None + type: Optional[str] = None + """ + The type of the policy. Supports a single value: COMPACT. + Specifying COMPACT placement policy type places node pool's nodes in a closer + physical proximity in order to reduce network latency between nodes. + """ + + +class GvnicItem(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class HostMaintenancePolicyItem(BaseModel): + maintenanceInterval: Optional[str] = None + + +class KubeletConfigItem(BaseModel): + allowedUnsafeSysctls: Optional[List[str]] = None + containerLogMaxFiles: Optional[float] = None + containerLogMaxSize: Optional[str] = None + cpuCfsQuota: Optional[bool] = None + cpuCfsQuotaPeriod: Optional[str] = None + cpuManagerPolicy: Optional[str] = None + imageGcHighThresholdPercent: Optional[float] = None + imageGcLowThresholdPercent: Optional[float] = None + imageMaximumGcAge: Optional[str] = None + imageMinimumGcAge: Optional[str] = None + insecureKubeletReadonlyPortEnabled: Optional[str] = None + podPidsLimit: Optional[float] = None + + +class HugepagesConfigItem(BaseModel): + hugepageSize1G: Optional[float] = None + hugepageSize2M: Optional[float] = None + + +class LinuxNodeConfigItem(BaseModel): + cgroupMode: Optional[str] = None + hugepagesConfig: Optional[List[HugepagesConfigItem]] = None + sysctls: Optional[Dict[str, str]] = None + + +class LocalNvmeSsdBlockConfigItem(BaseModel): + localSsdCount: Optional[float] = None + + +class ReservationAffinityItem(BaseModel): + consumeReservationType: Optional[str] = None + key: Optional[str] = None + values: Optional[List[str]] = None + + +class SecondaryBootDisk(BaseModel): + diskImage: Optional[str] = None + mode: Optional[str] = None + + +class ServiceAccountRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ShieldedInstanceConfigItem(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + enableSecureBoot: Optional[bool] = None + + +class NodeAffinityItem(BaseModel): + key: Optional[str] = None + operator: Optional[str] = None + values: Optional[List[str]] = None + + +class SoleTenantConfigItem(BaseModel): + nodeAffinity: Optional[List[NodeAffinityItem]] = None + + +class TaintItem(BaseModel): + effect: Optional[str] = None + key: Optional[str] = None + value: Optional[str] = None + + +class WindowsNodeConfigItem(BaseModel): + osversion: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class WorkloadMetadataConfigItem(BaseModel): + mode: Optional[str] = None + + +class NodeConfigItem(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + bootDiskKmsKey: Optional[str] = None + confidentialNodes: Optional[List[ConfidentialNode]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[List[ContainerdConfigItem]] = None + diskSizeGb: Optional[float] = None + diskType: Optional[str] = None + enableConfidentialStorage: Optional[bool] = None + ephemeralStorageLocalSsdConfig: Optional[ + List[EphemeralStorageLocalSsdConfigItem] + ] = None + fastSocket: Optional[List[FastSocketItem]] = None + flexStart: Optional[bool] = None + gcfsConfig: Optional[List[GcfsConfigItem]] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + gvnic: Optional[List[GvnicItem]] = None + hostMaintenancePolicy: Optional[List[HostMaintenancePolicyItem]] = None + imageType: Optional[str] = None + index: Optional[str] = '0' + """ + This is an injected field with a default value for being able to merge items of the parent object list. + """ + kubeletConfig: Optional[List[KubeletConfigItem]] = None + labels: Optional[Dict[str, str]] = None + linuxNodeConfig: Optional[List[LinuxNodeConfigItem]] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + localNvmeSsdBlockConfig: Optional[List[LocalNvmeSsdBlockConfigItem]] = None + localSsdCount: Optional[float] = None + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + machineType: Optional[str] = None + maxRunDuration: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + minCpuPlatform: Optional[str] = None + nodeGroup: Optional[str] = None + oauthScopes: Optional[List[str]] = None + preemptible: Optional[bool] = None + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + resourceLabels: Optional[Dict[str, str]] = None + resourceManagerTags: Optional[Dict[str, str]] = None + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + serviceAccount: Optional[str] = None + serviceAccountRef: Optional[ServiceAccountRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccount. + """ + serviceAccountSelector: Optional[ServiceAccountSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccount. + """ + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + soleTenantConfig: Optional[List[SoleTenantConfigItem]] = None + spot: Optional[bool] = None + storagePools: Optional[List[str]] = None + tags: Optional[List[str]] = None + taint: Optional[List[TaintItem]] = None + windowsNodeConfig: Optional[List[WindowsNodeConfigItem]] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + workloadMetadataConfig: Optional[List[WorkloadMetadataConfigItem]] = None + + +class PlacementPolicyItem(BaseModel): + policyName: Optional[str] = None + """ + If set, refers to the name of a custom resource policy supplied by the user. + The resource policy must be in the same project and region as the node pool. + If not found, InvalidArgument error is returned. + """ + tpuTopology: Optional[str] = None + """ + The TPU placement topology for pod slice node pool. + """ + type: Optional[str] = None + """ + The type of the policy. Supports a single value: COMPACT. + Specifying COMPACT placement policy type places node pool's nodes in a closer + physical proximity in order to reduce network latency between nodes. + """ + + +class QueuedProvisioningItem(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class StandardRolloutPolicyItem(BaseModel): + batchNodeCount: Optional[float] = None + """ + Number of blue nodes to drain in a batch. + """ + batchPercentage: Optional[float] = None + """ + Percentage of the blue pool nodes to drain in a batch. + """ + batchSoakDuration: Optional[str] = None + """ + (Optionial) Soak time after each batch gets drained. + """ + + +class BlueGreenSetting(BaseModel): + nodePoolSoakDuration: Optional[str] = None + """ + Time needed after draining the entire blue pool. + After this period, the blue pool will be cleaned up. + """ + standardRolloutPolicy: Optional[List[StandardRolloutPolicyItem]] = None + """ + Specifies the standard policy settings for blue-green upgrades. + """ + + +class UpgradeSetting(BaseModel): + blueGreenSettings: Optional[List[BlueGreenSetting]] = None + """ + The settings to adjust blue green upgrades. + Structure is documented below + """ + maxSurge: Optional[float] = None + """ + The number of additional nodes that can be added to the node pool during + an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. + Can be set to 0 or greater. + """ + maxUnavailable: Optional[float] = None + """ + The number of nodes that can be simultaneously unavailable during + an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in + parallel. Can be set to 0 or greater. + """ + strategy: Optional[str] = None + """ + (Default SURGE) The upgrade stragey to be used for upgrading the nodes. + """ + + +class ForProvider(BaseModel): + autoscaling: Optional[List[AutoscalingItem]] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + cluster: Optional[str] = None + """ + The cluster to create the node pool for. Cluster must be present in location provided for clusters. May be specified in the format projects/{{project}}/locations/{{location}}/clusters/{{cluster}} or as just the name of the cluster. + """ + clusterRef: Optional[ClusterRef] = None + """ + Reference to a Cluster in container to populate cluster. + """ + clusterSelector: Optional[ClusterSelector] = None + """ + Selector for a Cluster in container to populate cluster. + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + location: Optional[str] = None + """ + The location (region or zone) of the cluster. + """ + management: Optional[List[ManagementItem]] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[List[NetworkConfigItem]] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[List[NodeConfigItem]] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + placementPolicy: Optional[List[PlacementPolicyItem]] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[List[QueuedProvisioningItem]] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[List[UpgradeSetting]] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class InitProvider(BaseModel): + autoscaling: Optional[List[AutoscalingItem]] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + management: Optional[List[ManagementItem]] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[List[NetworkConfigItem]] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[List[NodeConfigItem]] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + placementPolicy: Optional[List[PlacementPolicyItem]] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[List[QueuedProvisioningItem]] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[List[UpgradeSetting]] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class NetworkConfigItemModel(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + """ + We specify the additional node networks for this node pool using this list. Each node network corresponds to an additional interface. + Structure is documented below + """ + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + """ + We specify the additional pod networks for this node pool using this list. Each pod network corresponds to an additional alias IP range for the node. + Structure is documented below + """ + createPodRange: Optional[bool] = None + """ + Whether to create a new range for pod IPs in this node pool. Defaults are provided for pod_range and pod_ipv4_cidr_block if they are not specified. + """ + enablePrivateNodes: Optional[bool] = None + """ + Whether nodes have internal IP addresses only. + """ + networkPerformanceConfig: Optional[List[NetworkPerformanceConfigItem]] = None + podCidrOverprovisionConfig: Optional[List[PodCidrOverprovisionConfigItem]] = None + podIpv4CidrBlock: Optional[str] = None + """ + The IP address range for pod IPs in this node pool. Only applicable if createPodRange is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) to pick a specific range to use. + """ + podRange: Optional[str] = None + """ + The ID of the secondary range for pod IPs. If create_pod_range is true, this ID is used for the new range. If create_pod_range is false, uses an existing secondary range with this ID. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class EffectiveTaint(BaseModel): + effect: Optional[str] = None + key: Optional[str] = None + value: Optional[str] = None + + +class NodeConfigItemModel(BaseModel): + advancedMachineFeatures: Optional[List[AdvancedMachineFeature]] = None + bootDiskKmsKey: Optional[str] = None + confidentialNodes: Optional[List[ConfidentialNode]] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[List[ContainerdConfigItem]] = None + diskSizeGb: Optional[float] = None + diskType: Optional[str] = None + effectiveTaints: Optional[List[EffectiveTaint]] = None + enableConfidentialStorage: Optional[bool] = None + ephemeralStorageLocalSsdConfig: Optional[ + List[EphemeralStorageLocalSsdConfigItem] + ] = None + fastSocket: Optional[List[FastSocketItem]] = None + flexStart: Optional[bool] = None + gcfsConfig: Optional[List[GcfsConfigItem]] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + gvnic: Optional[List[GvnicItem]] = None + hostMaintenancePolicy: Optional[List[HostMaintenancePolicyItem]] = None + imageType: Optional[str] = None + index: Optional[str] = '0' + """ + This is an injected field with a default value for being able to merge items of the parent object list. + """ + kubeletConfig: Optional[List[KubeletConfigItem]] = None + labels: Optional[Dict[str, str]] = None + linuxNodeConfig: Optional[List[LinuxNodeConfigItem]] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + localNvmeSsdBlockConfig: Optional[List[LocalNvmeSsdBlockConfigItem]] = None + localSsdCount: Optional[float] = None + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + machineType: Optional[str] = None + maxRunDuration: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + minCpuPlatform: Optional[str] = None + nodeGroup: Optional[str] = None + oauthScopes: Optional[List[str]] = None + preemptible: Optional[bool] = None + reservationAffinity: Optional[List[ReservationAffinityItem]] = None + resourceLabels: Optional[Dict[str, str]] = None + resourceManagerTags: Optional[Dict[str, str]] = None + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + serviceAccount: Optional[str] = None + shieldedInstanceConfig: Optional[List[ShieldedInstanceConfigItem]] = None + soleTenantConfig: Optional[List[SoleTenantConfigItem]] = None + spot: Optional[bool] = None + storagePools: Optional[List[str]] = None + tags: Optional[List[str]] = None + taint: Optional[List[TaintItem]] = None + windowsNodeConfig: Optional[List[WindowsNodeConfigItem]] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + workloadMetadataConfig: Optional[List[WorkloadMetadataConfigItem]] = None + + +class AtProvider(BaseModel): + autoscaling: Optional[List[AutoscalingItem]] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + cluster: Optional[str] = None + """ + The cluster to create the node pool for. Cluster must be present in location provided for clusters. May be specified in the format projects/{{project}}/locations/{{location}}/clusters/{{cluster}} or as just the name of the cluster. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{location}}/{{cluster}}/{{name}} + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + instanceGroupUrls: Optional[List[str]] = None + """ + The resource URLs of the managed instance groups associated with this node pool. + """ + location: Optional[str] = None + """ + The location (region or zone) of the cluster. + """ + managedInstanceGroupUrls: Optional[List[str]] = None + """ + List of instance group URLs which have been assigned to this node pool. + """ + management: Optional[List[ManagementItem]] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[List[NetworkConfigItemModel]] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[List[NodeConfigItemModel]] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + operation: Optional[str] = None + placementPolicy: Optional[List[PlacementPolicyItem]] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[List[QueuedProvisioningItem]] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[List[UpgradeSetting]] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodePool(BaseModel): + apiVersion: Optional[Literal['container.gcp.upbound.io/v1beta1']] = ( + 'container.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['NodePool']] = 'NodePool' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodePoolSpec defines the desired state of NodePool + """ + status: Optional[Status] = None + """ + NodePoolStatus defines the observed state of NodePool. + """ + + +class NodePoolList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodePool] + """ + List of nodepools. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/container/nodepool/v1beta2.py b/schemas/python/models/io/upbound/gcp/container/nodepool/v1beta2.py new file mode 100644 index 000000000..ca10f0065 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/container/nodepool/v1beta2.py @@ -0,0 +1,1084 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_upbound_io_v1beta2_nodepool.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class Autoscaling(BaseModel): + locationPolicy: Optional[str] = None + """ + Location policy specifies the algorithm used when + scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. + """ + maxNodeCount: Optional[float] = None + """ + Maximum number of nodes per zone in the NodePool. + Must be >= min_node_count. Cannot be used with total limits. + """ + minNodeCount: Optional[float] = None + """ + Minimum number of nodes per zone in the NodePool. + Must be >=0 and <= max_node_count. Cannot be used with total limits. + """ + totalMaxNodeCount: Optional[float] = None + """ + Total maximum number of nodes in the NodePool. + Must be >= total_min_node_count. Cannot be used with per zone limits. + Total size limits are supported only in 1.24.1+ clusters. + """ + totalMinNodeCount: Optional[float] = None + """ + Total minimum number of nodes in the NodePool. + Must be >=0 and <= total_max_node_count. Cannot be used with per zone limits. + Total size limits are supported only in 1.24.1+ clusters. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ClusterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ClusterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Management(BaseModel): + autoRepair: Optional[bool] = None + """ + Whether the nodes will be automatically repaired. Enabled by default. + """ + autoUpgrade: Optional[bool] = None + """ + Whether the nodes will be automatically upgraded. Enabled by default. + """ + + +class AdditionalNodeNetworkConfig(BaseModel): + network: Optional[str] = None + """ + Name of the VPC where the additional interface belongs. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class AdditionalPodNetworkConfig(BaseModel): + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + secondaryPodRange: Optional[str] = None + """ + The name of the secondary range on the subnet which provides IP address for this pod range. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + Specifies the total network bandwidth tier for the NodePool. Valid values include: "TIER_1" and "TIER_UNSPECIFIED". + """ + + +class PodCidrOverprovisionConfig(BaseModel): + disabled: Optional[bool] = None + """ + Whether pod cidr overprovision is disabled. + """ + + +class NetworkConfig(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + """ + We specify the additional node networks for this node pool using this list. Each node network corresponds to an additional interface. + Structure is documented below + """ + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + """ + We specify the additional pod networks for this node pool using this list. Each pod network corresponds to an additional alias IP range for the node. + Structure is documented below + """ + createPodRange: Optional[bool] = None + """ + Whether to create a new range for pod IPs in this node pool. Defaults are provided for pod_range and pod_ipv4_cidr_block if they are not specified. + """ + enablePrivateNodes: Optional[bool] = None + """ + Whether nodes have internal IP addresses only. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + """ + Configuration for node-pool level pod cidr overprovision. If not set, the cluster level setting will be inherited. Structure is documented below. + """ + podIpv4CidrBlock: Optional[str] = None + """ + The IP address range for pod IPs in this node pool. Only applicable if createPodRange is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) to pick a specific range to use. + """ + podRange: Optional[str] = None + """ + The ID of the secondary range for pod IPs. If create_pod_range is true, this ID is used for the new range. If create_pod_range is false, uses an existing secondary range with this ID. + """ + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + performanceMonitoringUnit: Optional[str] = None + threadsPerCore: Optional[float] = None + + +class ConfidentialNodes(BaseModel): + confidentialInstanceType: Optional[str] = None + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GcpSecretManagerCertificateConfig(BaseModel): + secretUri: Optional[str] = None + + +class CertificateAuthorityDomainConfigItem(BaseModel): + fqdns: Optional[List[str]] = None + gcpSecretManagerCertificateConfig: Optional[GcpSecretManagerCertificateConfig] = ( + None + ) + + +class PrivateRegistryAccessConfig(BaseModel): + certificateAuthorityDomainConfig: Optional[ + List[CertificateAuthorityDomainConfigItem] + ] = None + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class ContainerdConfig(BaseModel): + privateRegistryAccessConfig: Optional[PrivateRegistryAccessConfig] = None + + +class EphemeralStorageLocalSsdConfig(BaseModel): + dataCacheCount: Optional[float] = None + localSsdCount: Optional[float] = None + + +class FastSocket(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GcfsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GpuDriverInstallationConfig(BaseModel): + gpuDriverVersion: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class GpuSharingConfig(BaseModel): + gpuSharingStrategy: Optional[str] = None + maxSharedClientsPerGpu: Optional[float] = None + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + gpuDriverInstallationConfig: Optional[GpuDriverInstallationConfig] = None + gpuPartitionSize: Optional[str] = None + gpuSharingConfig: Optional[GpuSharingConfig] = None + type: Optional[str] = None + """ + The type of the policy. Supports a single value: COMPACT. + Specifying COMPACT placement policy type places node pool's nodes in a closer + physical proximity in order to reduce network latency between nodes. + """ + + +class Gvnic(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class HostMaintenancePolicy(BaseModel): + maintenanceInterval: Optional[str] = None + + +class KubeletConfig(BaseModel): + allowedUnsafeSysctls: Optional[List[str]] = None + containerLogMaxFiles: Optional[float] = None + containerLogMaxSize: Optional[str] = None + cpuCfsQuota: Optional[bool] = None + cpuCfsQuotaPeriod: Optional[str] = None + cpuManagerPolicy: Optional[str] = None + imageGcHighThresholdPercent: Optional[float] = None + imageGcLowThresholdPercent: Optional[float] = None + imageMaximumGcAge: Optional[str] = None + imageMinimumGcAge: Optional[str] = None + insecureKubeletReadonlyPortEnabled: Optional[str] = None + podPidsLimit: Optional[float] = None + + +class HugepagesConfig(BaseModel): + hugepageSize1G: Optional[float] = None + hugepageSize2M: Optional[float] = None + + +class LinuxNodeConfig(BaseModel): + cgroupMode: Optional[str] = None + hugepagesConfig: Optional[HugepagesConfig] = None + sysctls: Optional[Dict[str, str]] = None + + +class LocalNvmeSsdBlockConfig(BaseModel): + localSsdCount: Optional[float] = None + + +class ReservationAffinity(BaseModel): + consumeReservationType: Optional[str] = None + """ + The type of reservation consumption + Accepted values are: + """ + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SecondaryBootDisk(BaseModel): + diskImage: Optional[str] = None + mode: Optional[str] = None + + +class ServiceAccountRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + enableSecureBoot: Optional[bool] = None + + +class NodeAffinityItem(BaseModel): + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + operator: Optional[str] = None + values: Optional[List[str]] = None + """ + name" + """ + + +class SoleTenantConfig(BaseModel): + nodeAffinity: Optional[List[NodeAffinityItem]] = None + + +class TaintItem(BaseModel): + effect: Optional[str] = None + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + value: Optional[str] = None + + +class WindowsNodeConfig(BaseModel): + osversion: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class WorkloadMetadataConfig(BaseModel): + mode: Optional[str] = None + + +class NodeConfig(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + bootDiskKmsKey: Optional[str] = None + confidentialNodes: Optional[ConfidentialNodes] = None + containerdConfig: Optional[ContainerdConfig] = None + diskSizeGb: Optional[float] = None + diskType: Optional[str] = None + enableConfidentialStorage: Optional[bool] = None + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + fastSocket: Optional[FastSocket] = None + flexStart: Optional[bool] = None + gcfsConfig: Optional[GcfsConfig] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + gvnic: Optional[Gvnic] = None + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + imageType: Optional[str] = None + kubeletConfig: Optional[KubeletConfig] = None + labels: Optional[Dict[str, str]] = None + linuxNodeConfig: Optional[LinuxNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + localSsdCount: Optional[float] = None + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + machineType: Optional[str] = None + maxRunDuration: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + minCpuPlatform: Optional[str] = None + nodeGroup: Optional[str] = None + oauthScopes: Optional[List[str]] = None + preemptible: Optional[bool] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourceLabels: Optional[Dict[str, str]] = None + resourceManagerTags: Optional[Dict[str, str]] = None + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + serviceAccount: Optional[str] = None + serviceAccountRef: Optional[ServiceAccountRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccount. + """ + serviceAccountSelector: Optional[ServiceAccountSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccount. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + soleTenantConfig: Optional[SoleTenantConfig] = None + spot: Optional[bool] = None + storagePools: Optional[List[str]] = None + tags: Optional[List[str]] = None + taint: Optional[List[TaintItem]] = None + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + + +class PlacementPolicy(BaseModel): + policyName: Optional[str] = None + """ + If set, refers to the name of a custom resource policy supplied by the user. + The resource policy must be in the same project and region as the node pool. + If not found, InvalidArgument error is returned. + """ + tpuTopology: Optional[str] = None + """ + The TPU topology like "2x4" or "2x2x2". + """ + type: Optional[str] = None + """ + The type of the policy. Supports a single value: COMPACT. + Specifying COMPACT placement policy type places node pool's nodes in a closer + physical proximity in order to reduce network latency between nodes. + """ + + +class QueuedProvisioning(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class StandardRolloutPolicy(BaseModel): + batchNodeCount: Optional[float] = None + """ + Number of blue nodes to drain in a batch. + """ + batchPercentage: Optional[float] = None + """ + Percentage of the blue pool nodes to drain in a batch. + """ + batchSoakDuration: Optional[str] = None + """ + (Optionial) Soak time after each batch gets drained. + """ + + +class BlueGreenSettings(BaseModel): + nodePoolSoakDuration: Optional[str] = None + """ + Time needed after draining the entire blue pool. + After this period, the blue pool will be cleaned up. + """ + standardRolloutPolicy: Optional[StandardRolloutPolicy] = None + """ + Specifies the standard policy settings for blue-green upgrades. + """ + + +class UpgradeSettings(BaseModel): + blueGreenSettings: Optional[BlueGreenSettings] = None + """ + The settings to adjust blue green upgrades. + Structure is documented below + """ + maxSurge: Optional[float] = None + """ + The number of additional nodes that can be added to the node pool during + an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. + Can be set to 0 or greater. + """ + maxUnavailable: Optional[float] = None + """ + The number of nodes that can be simultaneously unavailable during + an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in + parallel. Can be set to 0 or greater. + """ + strategy: Optional[str] = None + """ + (Default SURGE) The upgrade strategy to be used for upgrading the nodes. + """ + + +class ForProvider(BaseModel): + autoscaling: Optional[Autoscaling] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + cluster: Optional[str] = None + """ + The cluster to create the node pool for. Cluster must be present in location provided for clusters. May be specified in the format projects/{{project}}/locations/{{location}}/clusters/{{cluster}} or as just the name of the cluster. + """ + clusterRef: Optional[ClusterRef] = None + """ + Reference to a Cluster in container to populate cluster. + """ + clusterSelector: Optional[ClusterSelector] = None + """ + Selector for a Cluster in container to populate cluster. + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + location: Optional[str] = None + """ + The location (region or zone) of the cluster. + """ + management: Optional[Management] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[NetworkConfig] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + placementPolicy: Optional[PlacementPolicy] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[QueuedProvisioning] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class InitProvider(BaseModel): + autoscaling: Optional[Autoscaling] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + management: Optional[Management] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[NetworkConfig] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + placementPolicy: Optional[PlacementPolicy] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[QueuedProvisioning] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class NetworkConfigModel(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + """ + We specify the additional node networks for this node pool using this list. Each node network corresponds to an additional interface. + Structure is documented below + """ + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + """ + We specify the additional pod networks for this node pool using this list. Each pod network corresponds to an additional alias IP range for the node. + Structure is documented below + """ + createPodRange: Optional[bool] = None + """ + Whether to create a new range for pod IPs in this node pool. Defaults are provided for pod_range and pod_ipv4_cidr_block if they are not specified. + """ + enablePrivateNodes: Optional[bool] = None + """ + Whether nodes have internal IP addresses only. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + """ + Configuration for node-pool level pod cidr overprovision. If not set, the cluster level setting will be inherited. Structure is documented below. + """ + podIpv4CidrBlock: Optional[str] = None + """ + The IP address range for pod IPs in this node pool. Only applicable if createPodRange is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) to pick a specific range to use. + """ + podRange: Optional[str] = None + """ + The ID of the secondary range for pod IPs. If create_pod_range is true, this ID is used for the new range. If create_pod_range is false, uses an existing secondary range with this ID. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class EffectiveTaint(BaseModel): + effect: Optional[str] = None + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + value: Optional[str] = None + + +class NodeConfigModel(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + bootDiskKmsKey: Optional[str] = None + confidentialNodes: Optional[ConfidentialNodes] = None + containerdConfig: Optional[ContainerdConfig] = None + diskSizeGb: Optional[float] = None + diskType: Optional[str] = None + effectiveTaints: Optional[List[EffectiveTaint]] = None + enableConfidentialStorage: Optional[bool] = None + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + fastSocket: Optional[FastSocket] = None + flexStart: Optional[bool] = None + gcfsConfig: Optional[GcfsConfig] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + gvnic: Optional[Gvnic] = None + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + imageType: Optional[str] = None + kubeletConfig: Optional[KubeletConfig] = None + labels: Optional[Dict[str, str]] = None + linuxNodeConfig: Optional[LinuxNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + localSsdCount: Optional[float] = None + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + machineType: Optional[str] = None + maxRunDuration: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + minCpuPlatform: Optional[str] = None + nodeGroup: Optional[str] = None + oauthScopes: Optional[List[str]] = None + preemptible: Optional[bool] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourceLabels: Optional[Dict[str, str]] = None + resourceManagerTags: Optional[Dict[str, str]] = None + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + serviceAccount: Optional[str] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + soleTenantConfig: Optional[SoleTenantConfig] = None + spot: Optional[bool] = None + storagePools: Optional[List[str]] = None + tags: Optional[List[str]] = None + taint: Optional[List[TaintItem]] = None + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + + +class AtProvider(BaseModel): + autoscaling: Optional[Autoscaling] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + cluster: Optional[str] = None + """ + The cluster to create the node pool for. Cluster must be present in location provided for clusters. May be specified in the format projects/{{project}}/locations/{{location}}/clusters/{{cluster}} or as just the name of the cluster. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{location}}/{{cluster}}/{{name}} + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + instanceGroupUrls: Optional[List[str]] = None + """ + The resource URLs of the managed instance groups associated with this node pool. + """ + location: Optional[str] = None + """ + The location (region or zone) of the cluster. + """ + managedInstanceGroupUrls: Optional[List[str]] = None + """ + List of instance group URLs which have been assigned to this node pool. + """ + management: Optional[Management] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[NetworkConfigModel] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[NodeConfigModel] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + operation: Optional[str] = None + placementPolicy: Optional[PlacementPolicy] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[QueuedProvisioning] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodePool(BaseModel): + apiVersion: Optional[Literal['container.gcp.upbound.io/v1beta2']] = ( + 'container.gcp.upbound.io/v1beta2' + ) + """ + 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[Literal['NodePool']] = 'NodePool' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodePoolSpec defines the desired state of NodePool + """ + status: Optional[Status] = None + """ + NodePoolStatus defines the observed state of NodePool. + """ + + +class NodePoolList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodePool] + """ + List of nodepools. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/gcp/container/registry/__init__.py b/schemas/python/models/io/upbound/gcp/container/registry/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/gcp/container/registry/v1beta1.py b/schemas/python/models/io/upbound/gcp/container/registry/v1beta1.py new file mode 100644 index 000000000..865271c04 --- /dev/null +++ b/schemas/python/models/io/upbound/gcp/container/registry/v1beta1.py @@ -0,0 +1,238 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_upbound_io_v1beta1_registry.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from .....k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + location: Optional[str] = None + """ + The location of the registry. One of ASIA, EU, US or not specified. See the official documentation for more information on registry locations. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + location: Optional[str] = None + """ + The location of the registry. One of ASIA, EU, US or not specified. See the official documentation for more information on registry locations. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it is not provided, the provider project is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProviderConfigRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + namespace: str + """ + Namespace of the secret. + """ + + +class Spec(BaseModel): + deletionPolicy: Optional[Literal['Orphan', 'Delete']] = 'Delete' + """ + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + """ + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate({'name': 'default'}) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bucketSelfLink: Optional[str] = None + """ + The URI of the created resource. + """ + id: Optional[str] = None + """ + The name of the bucket that supports the Container Registry. In the form of artifacts.{project}.appspot.com or {location}.artifacts.{project}.appspot.com if location is specified. + """ + location: Optional[str] = None + """ + The location of the registry. One of ASIA, EU, US or not specified. See the official documentation for more information on registry locations. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Registry(BaseModel): + apiVersion: Optional[Literal['container.gcp.upbound.io/v1beta1']] = ( + 'container.gcp.upbound.io/v1beta1' + ) + """ + 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[Literal['Registry']] = 'Registry' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegistrySpec defines the desired state of Registry + """ + status: Optional[Status] = None + """ + RegistryStatus defines the observed state of Registry. + """ + + +class RegistryList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Registry] + """ + List of registries. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/__init__.py b/schemas/python/models/io/upbound/m/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/__init__.py b/schemas/python/models/io/upbound/m/gcp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/folder/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/folder/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/folder/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/folder/v1beta1.py new file mode 100644 index 000000000..45c34fe4d --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/folder/v1beta1.py @@ -0,0 +1,313 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_folder.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ParentRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ParentSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + deletionProtection: Optional[bool] = None + """ + When the field is set to false, deleting the folder is allowed. Default value is true. + """ + displayName: Optional[str] = None + """ + The folder’s display name. + A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. + """ + parent: Optional[str] = None + """ + The resource name of the parent Folder or Organization. + Must be of the form folders/{folder_id} or organizations/{org_id}. + """ + parentRef: Optional[ParentRef] = None + """ + Reference to a Folder in cloudplatform to populate parent. + """ + parentSelector: Optional[ParentSelector] = None + """ + Selector for a Folder in cloudplatform to populate parent. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class InitProvider(BaseModel): + deletionProtection: Optional[bool] = None + """ + When the field is set to false, deleting the folder is allowed. Default value is true. + """ + displayName: Optional[str] = None + """ + The folder’s display name. + A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. + """ + parent: Optional[str] = None + """ + The resource name of the parent Folder or Organization. + Must be of the form folders/{folder_id} or organizations/{org_id}. + """ + parentRef: Optional[ParentRef] = None + """ + Reference to a Folder in cloudplatform to populate parent. + """ + parentSelector: Optional[ParentSelector] = None + """ + Selector for a Folder in cloudplatform to populate parent. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + createTime: Optional[str] = None + """ + Timestamp when the Folder was created. Assigned by the server. + A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". + """ + deletionProtection: Optional[bool] = None + """ + When the field is set to false, deleting the folder is allowed. Default value is true. + """ + displayName: Optional[str] = None + """ + The folder’s display name. + A folder’s display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. + """ + folderId: Optional[str] = None + """ + The folder id from the name "folders/{folder_id}" + """ + id: Optional[str] = None + lifecycleState: Optional[str] = None + """ + The lifecycle state of the folder such as ACTIVE or DELETE_REQUESTED. + """ + name: Optional[str] = None + """ + The resource name of the Folder. Its format is folders/{folder_id}. + """ + parent: Optional[str] = None + """ + The resource name of the parent Folder or Organization. + Must be of the form folders/{folder_id} or organizations/{org_id}. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Folder(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Folder']] = 'Folder' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FolderSpec defines the desired state of Folder + """ + status: Optional[Status] = None + """ + FolderStatus defines the observed state of Folder. + """ + + +class FolderList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Folder] + """ + List of folders. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/folderiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/folderiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/folderiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/folderiammember/v1beta1.py new file mode 100644 index 000000000..95d029e71 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/folderiammember/v1beta1.py @@ -0,0 +1,261 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_folderiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FolderRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FolderSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + folder: Optional[str] = None + folderRef: Optional[FolderRef] = None + """ + Reference to a Folder in cloudplatform to populate folder. + """ + folderSelector: Optional[FolderSelector] = None + """ + Selector for a Folder in cloudplatform to populate folder. + """ + member: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + folder: Optional[str] = None + folderRef: Optional[FolderRef] = None + """ + Reference to a Folder in cloudplatform to populate folder. + """ + folderSelector: Optional[FolderSelector] = None + """ + Selector for a Folder in cloudplatform to populate folder. + """ + member: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + folder: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FolderIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['FolderIAMMember']] = 'FolderIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FolderIAMMemberSpec defines the desired state of FolderIAMMember + """ + status: Optional[Status] = None + """ + FolderIAMMemberStatus defines the observed state of FolderIAMMember. + """ + + +class FolderIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FolderIAMMember] + """ + List of folderiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamauditconfig/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamauditconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py new file mode 100644 index 000000000..53d345255 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamauditconfig/v1beta1.py @@ -0,0 +1,189 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_organizationiamauditconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AuditLogConfigItem(BaseModel): + exemptedMembers: Optional[List[str]] = None + logType: Optional[str] = None + + +class ForProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + orgId: Optional[str] = None + service: Optional[str] = None + + +class InitProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + orgId: Optional[str] = None + service: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + orgId: Optional[str] = None + service: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class OrganizationIAMAuditConfig(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['OrganizationIAMAuditConfig']] = 'OrganizationIAMAuditConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + OrganizationIAMAuditConfigSpec defines the desired state of OrganizationIAMAuditConfig + """ + status: Optional[Status] = None + """ + OrganizationIAMAuditConfigStatus defines the observed state of OrganizationIAMAuditConfig. + """ + + +class OrganizationIAMAuditConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[OrganizationIAMAuditConfig] + """ + List of organizationiamauditconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamcustomrole/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamcustomrole/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py new file mode 100644 index 000000000..d017a7dbe --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiamcustomrole/v1beta1.py @@ -0,0 +1,263 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_organizationiamcustomrole.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization in which you want to create a custom role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + roleId: Optional[str] = None + """ + The role id to use for this role. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization in which you want to create a custom role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + roleId: Optional[str] = None + """ + The role id to use for this role. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deleted: Optional[bool] = None + """ + The current deleted state of the role. + """ + description: Optional[str] = None + """ + A human-readable description for the role. + """ + id: Optional[str] = None + """ + an identifier for the resource with the format organizations/{{org_id}}/roles/{{role_id}} + """ + name: Optional[str] = None + """ + The name of the role in the format organizations/{{org_id}}/roles/{{role_id}}. Like id, this field can be used as a reference in other resources such as IAM role bindings. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization in which you want to create a custom role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + roleId: Optional[str] = None + """ + The role id to use for this role. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class OrganizationIAMCustomRole(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['OrganizationIAMCustomRole']] = 'OrganizationIAMCustomRole' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + OrganizationIAMCustomRoleSpec defines the desired state of OrganizationIAMCustomRole + """ + status: Optional[Status] = None + """ + OrganizationIAMCustomRoleStatus defines the observed state of OrganizationIAMCustomRole. + """ + + +class OrganizationIAMCustomRoleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[OrganizationIAMCustomRole] + """ + List of organizationiamcustomroles. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiammember/v1beta1.py new file mode 100644 index 000000000..3592c028b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/organizationiammember/v1beta1.py @@ -0,0 +1,193 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_organizationiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + orgId: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class OrganizationIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['OrganizationIAMMember']] = 'OrganizationIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + OrganizationIAMMemberSpec defines the desired state of OrganizationIAMMember + """ + status: Optional[Status] = None + """ + OrganizationIAMMemberStatus defines the observed state of OrganizationIAMMember. + """ + + +class OrganizationIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[OrganizationIAMMember] + """ + List of organizationiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/project/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/project/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/project/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/project/v1beta1.py new file mode 100644 index 000000000..a9fc17cfd --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/project/v1beta1.py @@ -0,0 +1,422 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_project.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FolderIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FolderIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoCreateNetwork: Optional[bool] = None + """ + Controls whether the 'default' network exists on the project. Defaults + to true, where it is created. Therefore, for quota purposes, you will still need to have 1 + network slot available to create the project successfully, even if you set auto_create_network to + false.googleapis.com on the project to interact + with the GCE API and currently leaves it enabled. + """ + billingAccount: Optional[str] = None + """ + The alphanumeric ID of the billing account this project + belongs to.user) on the billing account. + See Google Cloud Billing API Access Control + for more details. + """ + deletionPolicy: Optional[str] = None + """ + The deletion policy for the Project. Setting ABANDON allows the resource + to be abandoned rather than deleted, i.e. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is PREVENT. + """ + folderId: Optional[str] = None + """ + The numeric ID of the folder this project should be + created under. Only one of org_id or folder_id may be + specified. If the folder_id is specified, then the project is + created under the specified folder. Changing this forces the + project to be migrated to the newly specified folder. + """ + folderIdRef: Optional[FolderIdRef] = None + """ + Reference to a Folder in cloudplatform to populate folderId. + """ + folderIdSelector: Optional[FolderIdSelector] = None + """ + Selector for a Folder in cloudplatform to populate folderId. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to the project. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + name: Optional[str] = None + """ + The display name of the project. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization this project belongs to. + Changing this forces a new project to be created. Only one of + org_id or folder_id may be specified. If the org_id is + specified then the project is created at the top level. Changing + this forces the project to be migrated to the newly specified + organization. + The numeric ID of the organization this project belongs to. + """ + projectId: Optional[str] = None + """ + The project ID. Changing this forces a new project to be created. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class InitProvider(BaseModel): + autoCreateNetwork: Optional[bool] = None + """ + Controls whether the 'default' network exists on the project. Defaults + to true, where it is created. Therefore, for quota purposes, you will still need to have 1 + network slot available to create the project successfully, even if you set auto_create_network to + false.googleapis.com on the project to interact + with the GCE API and currently leaves it enabled. + """ + billingAccount: Optional[str] = None + """ + The alphanumeric ID of the billing account this project + belongs to.user) on the billing account. + See Google Cloud Billing API Access Control + for more details. + """ + deletionPolicy: Optional[str] = None + """ + The deletion policy for the Project. Setting ABANDON allows the resource + to be abandoned rather than deleted, i.e. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is PREVENT. + """ + folderId: Optional[str] = None + """ + The numeric ID of the folder this project should be + created under. Only one of org_id or folder_id may be + specified. If the folder_id is specified, then the project is + created under the specified folder. Changing this forces the + project to be migrated to the newly specified folder. + """ + folderIdRef: Optional[FolderIdRef] = None + """ + Reference to a Folder in cloudplatform to populate folderId. + """ + folderIdSelector: Optional[FolderIdSelector] = None + """ + Selector for a Folder in cloudplatform to populate folderId. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to the project. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + name: Optional[str] = None + """ + The display name of the project. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization this project belongs to. + Changing this forces a new project to be created. Only one of + org_id or folder_id may be specified. If the org_id is + specified then the project is created at the top level. Changing + this forces the project to be migrated to the newly specified + organization. + The numeric ID of the organization this project belongs to. + """ + projectId: Optional[str] = None + """ + The project ID. Changing this forces a new project to be created. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoCreateNetwork: Optional[bool] = None + """ + Controls whether the 'default' network exists on the project. Defaults + to true, where it is created. Therefore, for quota purposes, you will still need to have 1 + network slot available to create the project successfully, even if you set auto_create_network to + false.googleapis.com on the project to interact + with the GCE API and currently leaves it enabled. + """ + billingAccount: Optional[str] = None + """ + The alphanumeric ID of the billing account this project + belongs to.user) on the billing account. + See Google Cloud Billing API Access Control + for more details. + """ + deletionPolicy: Optional[str] = None + """ + The deletion policy for the Project. Setting ABANDON allows the resource + to be abandoned rather than deleted, i.e. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is PREVENT. + """ + effectiveLabels: Optional[Dict[str, str]] = None + folderId: Optional[str] = None + """ + The numeric ID of the folder this project should be + created under. Only one of org_id or folder_id may be + specified. If the folder_id is specified, then the project is + created under the specified folder. Changing this forces the + project to be migrated to the newly specified folder. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}} + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to the project. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + name: Optional[str] = None + """ + The display name of the project. + """ + number: Optional[str] = None + """ + The numeric identifier of the project. + """ + orgId: Optional[str] = None + """ + The numeric ID of the organization this project belongs to. + Changing this forces a new project to be created. Only one of + org_id or folder_id may be specified. If the org_id is + specified then the project is created at the top level. Changing + this forces the project to be migrated to the newly specified + organization. + The numeric ID of the organization this project belongs to. + """ + projectId: Optional[str] = None + """ + The project ID. Changing this forces a new project to be created. + """ + tags: Optional[Dict[str, str]] = None + """ + A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. The field is immutable and causes resource replacement when mutated. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Project(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Project']] = 'Project' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectSpec defines the desired state of Project + """ + status: Optional[Status] = None + """ + ProjectStatus defines the observed state of Project. + """ + + +class ProjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Project] + """ + List of projects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectdefaultserviceaccounts/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectdefaultserviceaccounts/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py new file mode 100644 index 000000000..4c2590cc1 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectdefaultserviceaccounts/v1beta1.py @@ -0,0 +1,296 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_projectdefaultserviceaccounts.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + action: Optional[str] = None + """ + The action to be performed in the default service accounts. Valid values are: DEPRIVILEGE, DELETE, DISABLE. Note that DEPRIVILEGE action will ignore the REVERT configuration in the restore_policy + """ + project: Optional[str] = None + """ + The project ID where service accounts are created. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + restorePolicy: Optional[str] = None + """ + The action to be performed in the default service accounts on the resource destroy. + Valid values are NONE, REVERT and REVERT_AND_IGNORE_FAILURE. It is applied for any action but in the DEPRIVILEGE. + If set to REVERT it attempts to restore all default SAs but the DEPRIVILEGE action. + If set to REVERT_AND_IGNORE_FAILURE it is the same behavior as REVERT but ignores errors returned by the API. + """ + + +class InitProvider(BaseModel): + action: Optional[str] = None + """ + The action to be performed in the default service accounts. Valid values are: DEPRIVILEGE, DELETE, DISABLE. Note that DEPRIVILEGE action will ignore the REVERT configuration in the restore_policy + """ + project: Optional[str] = None + """ + The project ID where service accounts are created. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + restorePolicy: Optional[str] = None + """ + The action to be performed in the default service accounts on the resource destroy. + Valid values are NONE, REVERT and REVERT_AND_IGNORE_FAILURE. It is applied for any action but in the DEPRIVILEGE. + If set to REVERT it attempts to restore all default SAs but the DEPRIVILEGE action. + If set to REVERT_AND_IGNORE_FAILURE it is the same behavior as REVERT but ignores errors returned by the API. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + action: Optional[str] = None + """ + The action to be performed in the default service accounts. Valid values are: DEPRIVILEGE, DELETE, DISABLE. Note that DEPRIVILEGE action will ignore the REVERT configuration in the restore_policy + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}} + """ + project: Optional[str] = None + """ + The project ID where service accounts are created. + """ + restorePolicy: Optional[str] = None + """ + The action to be performed in the default service accounts on the resource destroy. + Valid values are NONE, REVERT and REVERT_AND_IGNORE_FAILURE. It is applied for any action but in the DEPRIVILEGE. + If set to REVERT it attempts to restore all default SAs but the DEPRIVILEGE action. + If set to REVERT_AND_IGNORE_FAILURE it is the same behavior as REVERT but ignores errors returned by the API. + """ + serviceAccounts: Optional[Dict[str, str]] = None + """ + The Service Accounts changed by this resource. It is used for REVERT the action on the destroy. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectDefaultServiceAccounts(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectDefaultServiceAccounts']] = ( + 'ProjectDefaultServiceAccounts' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectDefaultServiceAccountsSpec defines the desired state of ProjectDefaultServiceAccounts + """ + status: Optional[Status] = None + """ + ProjectDefaultServiceAccountsStatus defines the observed state of ProjectDefaultServiceAccounts. + """ + + +class ProjectDefaultServiceAccountsList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectDefaultServiceAccounts] + """ + List of projectdefaultserviceaccounts. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamauditconfig/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamauditconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamauditconfig/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamauditconfig/v1beta1.py new file mode 100644 index 000000000..3fcea3c03 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamauditconfig/v1beta1.py @@ -0,0 +1,257 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_projectiamauditconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AuditLogConfigItem(BaseModel): + exemptedMembers: Optional[List[str]] = None + logType: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + + +class InitProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + auditLogConfig: Optional[List[AuditLogConfigItem]] = None + etag: Optional[str] = None + id: Optional[str] = None + project: Optional[str] = None + service: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectIAMAuditConfig(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectIAMAuditConfig']] = 'ProjectIAMAuditConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectIAMAuditConfigSpec defines the desired state of ProjectIAMAuditConfig + """ + status: Optional[Status] = None + """ + ProjectIAMAuditConfigStatus defines the observed state of ProjectIAMAuditConfig. + """ + + +class ProjectIAMAuditConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectIAMAuditConfig] + """ + List of projectiamauditconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamcustomrole/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamcustomrole/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamcustomrole/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamcustomrole/v1beta1.py new file mode 100644 index 000000000..9ae682480 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiamcustomrole/v1beta1.py @@ -0,0 +1,254 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_projectiamcustomrole.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + project: Optional[str] = None + """ + The project that the custom role will be created in. + Defaults to the provider project configuration. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + A human-readable description for the role. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + project: Optional[str] = None + """ + The project that the custom role will be created in. + Defaults to the provider project configuration. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deleted: Optional[bool] = None + """ + The current deleted state of the role. + """ + description: Optional[str] = None + """ + A human-readable description for the role. + """ + id: Optional[str] = None + """ + an identifier for the resource with the format projects/{{project}}/roles/{{role_id}} + """ + name: Optional[str] = None + """ + The name of the role in the format projects/{{project}}/roles/{{role_id}}. Like id, this field can be used as a reference in other resources such as IAM role bindings. + """ + permissions: Optional[List[str]] = None + """ + The names of the permissions this role grants when bound in an IAM policy. At least one permission must be specified. + """ + project: Optional[str] = None + """ + The project that the custom role will be created in. + Defaults to the provider project configuration. + """ + stage: Optional[str] = None + """ + The current launch stage of the role. + Defaults to GA. + List of possible stages is here. + """ + title: Optional[str] = None + """ + A human-readable title for the role. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectIAMCustomRole(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectIAMCustomRole']] = 'ProjectIAMCustomRole' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectIAMCustomRoleSpec defines the desired state of ProjectIAMCustomRole + """ + status: Optional[Status] = None + """ + ProjectIAMCustomRoleStatus defines the observed state of ProjectIAMCustomRole. + """ + + +class ProjectIAMCustomRoleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectIAMCustomRole] + """ + List of projectiamcustomroles. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiammember/v1beta1.py new file mode 100644 index 000000000..6687b4c82 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectiammember/v1beta1.py @@ -0,0 +1,261 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_projectiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectIAMMember']] = 'ProjectIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectIAMMemberSpec defines the desired state of ProjectIAMMember + """ + status: Optional[Status] = None + """ + ProjectIAMMemberStatus defines the observed state of ProjectIAMMember. + """ + + +class ProjectIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectIAMMember] + """ + List of projectiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectservice/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectservice/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectservice/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectservice/v1beta1.py new file mode 100644 index 000000000..1262772f7 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectservice/v1beta1.py @@ -0,0 +1,311 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_projectservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + disableDependentServices: Optional[bool] = None + """ + If true, services that are enabled + and which depend on this service should also be disabled when this service is + destroyed. If false or unset, an error will be returned if any enabled + services depend on this service when attempting to destroy it. + """ + disableOnDestroy: Optional[bool] = None + """ + Defaults to true. Most configurations should + set this to false; it should generally only be true or unset in configurations + that manage the google_project resource itself. + """ + project: Optional[str] = None + """ + The project ID. If not provided, the provider project + is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + """ + The service to enable. + """ + + +class InitProvider(BaseModel): + disableDependentServices: Optional[bool] = None + """ + If true, services that are enabled + and which depend on this service should also be disabled when this service is + destroyed. If false or unset, an error will be returned if any enabled + services depend on this service when attempting to destroy it. + """ + disableOnDestroy: Optional[bool] = None + """ + Defaults to true. Most configurations should + set this to false; it should generally only be true or unset in configurations + that manage the google_project resource itself. + """ + project: Optional[str] = None + """ + The project ID. If not provided, the provider project + is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + service: Optional[str] = None + """ + The service to enable. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + disableDependentServices: Optional[bool] = None + """ + If true, services that are enabled + and which depend on this service should also be disabled when this service is + destroyed. If false or unset, an error will be returned if any enabled + services depend on this service when attempting to destroy it. + """ + disableOnDestroy: Optional[bool] = None + """ + Defaults to true. Most configurations should + set this to false; it should generally only be true or unset in configurations + that manage the google_project resource itself. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{service}} + """ + project: Optional[str] = None + """ + The project ID. If not provided, the provider project + is used. + """ + service: Optional[str] = None + """ + The service to enable. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectService(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectService']] = 'ProjectService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectServiceSpec defines the desired state of ProjectService + """ + status: Optional[Status] = None + """ + ProjectServiceStatus defines the observed state of ProjectService. + """ + + +class ProjectServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectService] + """ + List of projectservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectusageexportbucket/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectusageexportbucket/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectusageexportbucket/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectusageexportbucket/v1beta1.py new file mode 100644 index 000000000..ad4acca34 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/projectusageexportbucket/v1beta1.py @@ -0,0 +1,329 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_projectusageexportbucket.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BucketNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BucketNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bucketName: Optional[str] = None + """ + : The bucket to store reports in. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + prefix: Optional[str] = None + """ + : A prefix for the reports, for instance, the project name. + """ + project: Optional[str] = None + """ + : The project to set the export bucket on. If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class InitProvider(BaseModel): + bucketName: Optional[str] = None + """ + : The bucket to store reports in. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + prefix: Optional[str] = None + """ + : A prefix for the reports, for instance, the project name. + """ + project: Optional[str] = None + """ + : The project to set the export bucket on. If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bucketName: Optional[str] = None + """ + : The bucket to store reports in. + """ + id: Optional[str] = None + prefix: Optional[str] = None + """ + : A prefix for the reports, for instance, the project name. + """ + project: Optional[str] = None + """ + : The project to set the export bucket on. If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectUsageExportBucket(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectUsageExportBucket']] = 'ProjectUsageExportBucket' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectUsageExportBucketSpec defines the desired state of ProjectUsageExportBucket + """ + status: Optional[Status] = None + """ + ProjectUsageExportBucketStatus defines the observed state of ProjectUsageExportBucket. + """ + + +class ProjectUsageExportBucketList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectUsageExportBucket] + """ + List of projectusageexportbuckets. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccount/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccount/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccount/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccount/v1beta1.py new file mode 100644 index 000000000..b88b9eb1e --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccount/v1beta1.py @@ -0,0 +1,267 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_serviceaccount.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + createIgnoreAlreadyExists: Optional[bool] = None + """ + If set to true, skip service account creation if a service account with the same email already exists. + """ + description: Optional[str] = None + """ + A text description of the service account. + Must be less than or equal to 256 UTF-8 bytes. + """ + disabled: Optional[bool] = None + """ + Whether a service account is disabled or not. Defaults to false. This field has no effect during creation. + Must be set after creation to disable a service account. + """ + displayName: Optional[str] = None + """ + The display name for the service account. + Can be updated without creating a new resource. + """ + project: Optional[str] = None + """ + The ID of the project that the service account will be created in. + Defaults to the provider project configuration. + """ + + +class InitProvider(BaseModel): + createIgnoreAlreadyExists: Optional[bool] = None + """ + If set to true, skip service account creation if a service account with the same email already exists. + """ + description: Optional[str] = None + """ + A text description of the service account. + Must be less than or equal to 256 UTF-8 bytes. + """ + disabled: Optional[bool] = None + """ + Whether a service account is disabled or not. Defaults to false. This field has no effect during creation. + Must be set after creation to disable a service account. + """ + displayName: Optional[str] = None + """ + The display name for the service account. + Can be updated without creating a new resource. + """ + project: Optional[str] = None + """ + The ID of the project that the service account will be created in. + Defaults to the provider project configuration. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + createIgnoreAlreadyExists: Optional[bool] = None + """ + If set to true, skip service account creation if a service account with the same email already exists. + """ + description: Optional[str] = None + """ + A text description of the service account. + Must be less than or equal to 256 UTF-8 bytes. + """ + disabled: Optional[bool] = None + """ + Whether a service account is disabled or not. Defaults to false. This field has no effect during creation. + Must be set after creation to disable a service account. + """ + displayName: Optional[str] = None + """ + The display name for the service account. + Can be updated without creating a new resource. + """ + email: Optional[str] = None + """ + The e-mail address of the service account. This value + should be referenced from any google_iam_policy data sources + that would grant the service account privileges. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/serviceAccounts/{{email}} + """ + member: Optional[str] = None + """ + The Identity of the service account in the form serviceAccount:{email}. This value is often used to refer to the service account in order to grant IAM permissions. + """ + name: Optional[str] = None + """ + The fully-qualified name of the service account. + """ + project: Optional[str] = None + """ + The ID of the project that the service account will be created in. + Defaults to the provider project configuration. + """ + uniqueId: Optional[str] = None + """ + The unique id of the service account. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAccount(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAccount']] = 'ServiceAccount' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAccountSpec defines the desired state of ServiceAccount + """ + status: Optional[Status] = None + """ + ServiceAccountStatus defines the observed state of ServiceAccount. + """ + + +class ServiceAccountList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAccount] + """ + List of serviceaccounts. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountiammember/v1beta1.py new file mode 100644 index 000000000..99b889bb6 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountiammember/v1beta1.py @@ -0,0 +1,261 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_serviceaccountiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ServiceAccountIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + role: Optional[str] = None + serviceAccountId: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAccountIAMMember(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAccountIAMMember']] = 'ServiceAccountIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAccountIAMMemberSpec defines the desired state of ServiceAccountIAMMember + """ + status: Optional[Status] = None + """ + ServiceAccountIAMMemberStatus defines the observed state of ServiceAccountIAMMember. + """ + + +class ServiceAccountIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAccountIAMMember] + """ + List of serviceaccountiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountkey/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountkey/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountkey/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountkey/v1beta1.py new file mode 100644 index 000000000..113ae4619 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/serviceaccountkey/v1beta1.py @@ -0,0 +1,358 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_serviceaccountkey.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ServiceAccountIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + keepers: Optional[Dict[str, str]] = None + """ + Arbitrary map of values that, when changed, will trigger a new key to be generated. + """ + keyAlgorithm: Optional[str] = None + """ + The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. + Valid values are listed at + ServiceAccountPrivateKeyType + (only used on create) + """ + privateKeyType: Optional[str] = None + """ + The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format. + """ + publicKeyData: Optional[str] = None + """ + Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509_PEM and it conflicts with public_key_type and private_key_type. + """ + publicKeyType: Optional[str] = None + """ + The output format of the public key requested. TYPE_X509_PEM_FILE is the default output format. + """ + serviceAccountId: Optional[str] = None + """ + The Service account id of the Key. This can be a string in the format + {ACCOUNT} or projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. If the {ACCOUNT}-only syntax is used, either + the full email address of the service account or its name can be specified as a value, in which case the project will + automatically be inferred from the account. Otherwise, if the projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT} + syntax is used, the {ACCOUNT} specified can be the full email address of the service account or the service account's + unique id. Substituting - as a wildcard for the {PROJECT_ID} will infer the project from the account. + """ + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class InitProvider(BaseModel): + keepers: Optional[Dict[str, str]] = None + """ + Arbitrary map of values that, when changed, will trigger a new key to be generated. + """ + keyAlgorithm: Optional[str] = None + """ + The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. + Valid values are listed at + ServiceAccountPrivateKeyType + (only used on create) + """ + privateKeyType: Optional[str] = None + """ + The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format. + """ + publicKeyData: Optional[str] = None + """ + Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509_PEM and it conflicts with public_key_type and private_key_type. + """ + publicKeyType: Optional[str] = None + """ + The output format of the public key requested. TYPE_X509_PEM_FILE is the default output format. + """ + serviceAccountId: Optional[str] = None + """ + The Service account id of the Key. This can be a string in the format + {ACCOUNT} or projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. If the {ACCOUNT}-only syntax is used, either + the full email address of the service account or its name can be specified as a value, in which case the project will + automatically be inferred from the account. Otherwise, if the projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT} + syntax is used, the {ACCOUNT} specified can be the full email address of the service account or the service account's + unique id. Substituting - as a wildcard for the {PROJECT_ID} will infer the project from the account. + """ + serviceAccountIdRef: Optional[ServiceAccountIdRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + serviceAccountIdSelector: Optional[ServiceAccountIdSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccountId. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/serviceAccounts/{{account}}/keys/{{key}} + """ + keepers: Optional[Dict[str, str]] = None + """ + Arbitrary map of values that, when changed, will trigger a new key to be generated. + """ + keyAlgorithm: Optional[str] = None + """ + The algorithm used to generate the key. KEY_ALG_RSA_2048 is the default algorithm. + Valid values are listed at + ServiceAccountPrivateKeyType + (only used on create) + """ + name: Optional[str] = None + """ + The name used for this key pair + """ + privateKeyType: Optional[str] = None + """ + The output format of the private key. TYPE_GOOGLE_CREDENTIALS_FILE is the default output format. + """ + publicKey: Optional[str] = None + """ + The public key, base64 encoded + """ + publicKeyData: Optional[str] = None + """ + Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509_PEM and it conflicts with public_key_type and private_key_type. + """ + publicKeyType: Optional[str] = None + """ + The output format of the public key requested. TYPE_X509_PEM_FILE is the default output format. + """ + serviceAccountId: Optional[str] = None + """ + The Service account id of the Key. This can be a string in the format + {ACCOUNT} or projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. If the {ACCOUNT}-only syntax is used, either + the full email address of the service account or its name can be specified as a value, in which case the project will + automatically be inferred from the account. Otherwise, if the projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT} + syntax is used, the {ACCOUNT} specified can be the full email address of the service account or the service account's + unique id. Substituting - as a wildcard for the {PROJECT_ID} will infer the project from the account. + """ + validAfter: Optional[str] = None + """ + The key can be used after this timestamp. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". + """ + validBefore: Optional[str] = None + """ + The key can be used before this timestamp. + A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAccountKey(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAccountKey']] = 'ServiceAccountKey' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAccountKeySpec defines the desired state of ServiceAccountKey + """ + status: Optional[Status] = None + """ + ServiceAccountKeyStatus defines the observed state of ServiceAccountKey. + """ + + +class ServiceAccountKeyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAccountKey] + """ + List of serviceaccountkeys. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/servicenetworkingpeereddnsdomain/__init__.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/servicenetworkingpeereddnsdomain/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py new file mode 100644 index 000000000..67ecb2be3 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/cloudplatform/servicenetworkingpeereddnsdomain/v1beta1.py @@ -0,0 +1,223 @@ +# generated by datamodel-codegen: +# filename: workdir/cloudplatform_gcp_m_upbound_io_v1beta1_servicenetworkingpeereddnsdomain.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + dnsSuffix: Optional[str] = None + """ + The DNS domain suffix of the peered DNS domain. Make sure to suffix with a . (dot). + """ + network: str + """ + The network in the consumer project. + """ + project: Optional[str] = None + """ + The producer project number. If not provided, the provider project is used. + """ + service: str + """ + Private service connection between service and consumer network, defaults to servicenetworking.googleapis.com + """ + + +class InitProvider(BaseModel): + dnsSuffix: Optional[str] = None + """ + The DNS domain suffix of the peered DNS domain. Make sure to suffix with a . (dot). + """ + project: Optional[str] = None + """ + The producer project number. If not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + dnsSuffix: Optional[str] = None + """ + The DNS domain suffix of the peered DNS domain. Make sure to suffix with a . (dot). + """ + id: Optional[str] = None + """ + an identifier for the resource with format services/{{service}}/projects/{{project}}/global/networks/{{network}}/peeredDnsDomains/{{name}} + """ + network: Optional[str] = None + """ + The network in the consumer project. + """ + parent: Optional[str] = None + """ + an identifier for the resource with format services/{{service}}/projects/{{project}}/global/networks/{{network}} + """ + project: Optional[str] = None + """ + The producer project number. If not provided, the provider project is used. + """ + service: Optional[str] = None + """ + Private service connection between service and consumer network, defaults to servicenetworking.googleapis.com + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceNetworkingPeeredDNSDomain(BaseModel): + apiVersion: Optional[Literal['cloudplatform.gcp.m.upbound.io/v1beta1']] = ( + 'cloudplatform.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceNetworkingPeeredDNSDomain']] = ( + 'ServiceNetworkingPeeredDNSDomain' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceNetworkingPeeredDNSDomainSpec defines the desired state of ServiceNetworkingPeeredDNSDomain + """ + status: Optional[Status] = None + """ + ServiceNetworkingPeeredDNSDomainStatus defines the observed state of ServiceNetworkingPeeredDNSDomain. + """ + + +class ServiceNetworkingPeeredDNSDomainList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceNetworkingPeeredDNSDomain] + """ + List of servicenetworkingpeereddnsdomains. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/address/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/address/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/address/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/address/v1beta1.py new file mode 100644 index 000000000..facdd9e28 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/address/v1beta1.py @@ -0,0 +1,530 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_address.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + address: Optional[str] = None + """ + The static external IP address represented by this resource. + The IP address must be inside the specified subnetwork, + if any. Set by the API if undefined. + """ + addressType: Optional[str] = None + """ + The type of address to reserve. + Note: if you set this argument's value as INTERNAL you need to leave the network_tier argument unset in that resource block. + Default value is EXTERNAL. + Possible values are: INTERNAL, EXTERNAL. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + ipv6EndpointType: Optional[str] = None + """ + The endpoint type of this address, which should be VM or NETLB. This is + used for deciding which type of endpoint this address can be used after + the external IPv6 address reservation. + Possible values are: VM, NETLB. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the address. This field + can only be used with INTERNAL type with the VPC_PEERING and + IPSEC_INTERCONNECT purposes. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + The networking tier used for configuring this address. If this field is not + specified, it is assumed to be PREMIUM. + This argument should not be used when configuring Internal addresses, because network tier cannot be set for internal traffic; it's always Premium. + Possible values are: PREMIUM, STANDARD. + """ + prefixLength: Optional[float] = None + """ + The prefix length if the resource represents an IP range. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of this resource, which can be one of the following values. + """ + region: str + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + subnetwork: Optional[str] = None + """ + The URL of the subnetwork in which to reserve the address. If an IP + address is specified, it must be within the subnetwork's IP range. + This field can only be used with INTERNAL type with + GCE_ENDPOINT/DNS_RESOLVER purposes. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + address: Optional[str] = None + """ + The static external IP address represented by this resource. + The IP address must be inside the specified subnetwork, + if any. Set by the API if undefined. + """ + addressType: Optional[str] = None + """ + The type of address to reserve. + Note: if you set this argument's value as INTERNAL you need to leave the network_tier argument unset in that resource block. + Default value is EXTERNAL. + Possible values are: INTERNAL, EXTERNAL. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + ipv6EndpointType: Optional[str] = None + """ + The endpoint type of this address, which should be VM or NETLB. This is + used for deciding which type of endpoint this address can be used after + the external IPv6 address reservation. + Possible values are: VM, NETLB. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the address. This field + can only be used with INTERNAL type with the VPC_PEERING and + IPSEC_INTERCONNECT purposes. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + The networking tier used for configuring this address. If this field is not + specified, it is assumed to be PREMIUM. + This argument should not be used when configuring Internal addresses, because network tier cannot be set for internal traffic; it's always Premium. + Possible values are: PREMIUM, STANDARD. + """ + prefixLength: Optional[float] = None + """ + The prefix length if the resource represents an IP range. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of this resource, which can be one of the following values. + """ + subnetwork: Optional[str] = None + """ + The URL of the subnetwork in which to reserve the address. If an IP + address is specified, it must be within the subnetwork's IP range. + This field can only be used with INTERNAL type with + GCE_ENDPOINT/DNS_RESOLVER purposes. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + address: Optional[str] = None + """ + The static external IP address represented by this resource. + The IP address must be inside the specified subnetwork, + if any. Set by the API if undefined. + """ + addressType: Optional[str] = None + """ + The type of address to reserve. + Note: if you set this argument's value as INTERNAL you need to leave the network_tier argument unset in that resource block. + Default value is EXTERNAL. + Possible values are: INTERNAL, EXTERNAL. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/addresses/{{name}} + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + ipv6EndpointType: Optional[str] = None + """ + The endpoint type of this address, which should be VM or NETLB. This is + used for deciding which type of endpoint this address can be used after + the external IPv6 address reservation. + Possible values are: VM, NETLB. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the address. This field + can only be used with INTERNAL type with the VPC_PEERING and + IPSEC_INTERCONNECT purposes. + """ + networkTier: Optional[str] = None + """ + The networking tier used for configuring this address. If this field is not + specified, it is assumed to be PREMIUM. + This argument should not be used when configuring Internal addresses, because network tier cannot be set for internal traffic; it's always Premium. + Possible values are: PREMIUM, STANDARD. + """ + prefixLength: Optional[float] = None + """ + The prefix length if the resource represents an IP range. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of this resource, which can be one of the following values. + """ + region: Optional[str] = None + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subnetwork: Optional[str] = None + """ + The URL of the subnetwork in which to reserve the address. If an IP + address is specified, it must be within the subnetwork's IP range. + This field can only be used with INTERNAL type with + GCE_ENDPOINT/DNS_RESOLVER purposes. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + users: Optional[List[str]] = None + """ + The URLs of the resources that are using this address. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Address(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Address']] = 'Address' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + AddressSpec defines the desired state of Address + """ + status: Optional[Status] = None + """ + AddressStatus defines the observed state of Address. + """ + + +class AddressList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Address] + """ + List of addresses. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/attacheddisk/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/attacheddisk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/attacheddisk/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/attacheddisk/v1beta1.py new file mode 100644 index 000000000..fdd16df4a --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/attacheddisk/v1beta1.py @@ -0,0 +1,413 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_attacheddisk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class InstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + deviceName: Optional[str] = None + """ + Specifies a unique device name of your choice that is + reflected into the /dev/disk/by-id/google-* tree of a Linux operating + system running within the instance. This name can be used to + reference the device for mounting, resizing, and so on, from within + the instance. + """ + disk: Optional[str] = None + """ + name or self_link of the disk that will be attached. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + instance: Optional[str] = None + """ + name or self_link of the compute instance that the disk will be attached to. + If the self_link is provided then zone and project are extracted from the + self link. If only the name is used then zone and project must be defined + as properties on the resource or provider. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + interface: Optional[str] = None + """ + The disk interface used for attaching this disk. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE or + READ_ONLY. If not specified, the default is to attach the disk in + READ_WRITE mode. + """ + project: Optional[str] = None + """ + The project that the referenced compute instance is a part of. If instance is referenced by its + self_link the project defined in the link will take precedence. + """ + zone: Optional[str] = None + """ + The zone that the referenced compute instance is located within. If instance is referenced by its + self_link the zone defined in the link will take precedence. + """ + + +class InitProvider(BaseModel): + deviceName: Optional[str] = None + """ + Specifies a unique device name of your choice that is + reflected into the /dev/disk/by-id/google-* tree of a Linux operating + system running within the instance. This name can be used to + reference the device for mounting, resizing, and so on, from within + the instance. + """ + disk: Optional[str] = None + """ + name or self_link of the disk that will be attached. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + instance: Optional[str] = None + """ + name or self_link of the compute instance that the disk will be attached to. + If the self_link is provided then zone and project are extracted from the + self link. If only the name is used then zone and project must be defined + as properties on the resource or provider. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + interface: Optional[str] = None + """ + The disk interface used for attaching this disk. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE or + READ_ONLY. If not specified, the default is to attach the disk in + READ_WRITE mode. + """ + project: Optional[str] = None + """ + The project that the referenced compute instance is a part of. If instance is referenced by its + self_link the project defined in the link will take precedence. + """ + zone: Optional[str] = None + """ + The zone that the referenced compute instance is located within. If instance is referenced by its + self_link the zone defined in the link will take precedence. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deviceName: Optional[str] = None + """ + Specifies a unique device name of your choice that is + reflected into the /dev/disk/by-id/google-* tree of a Linux operating + system running within the instance. This name can be used to + reference the device for mounting, resizing, and so on, from within + the instance. + """ + disk: Optional[str] = None + """ + name or self_link of the disk that will be attached. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/disks/{{disk.name}} + """ + instance: Optional[str] = None + """ + name or self_link of the compute instance that the disk will be attached to. + If the self_link is provided then zone and project are extracted from the + self link. If only the name is used then zone and project must be defined + as properties on the resource or provider. + """ + interface: Optional[str] = None + """ + The disk interface used for attaching this disk. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE or + READ_ONLY. If not specified, the default is to attach the disk in + READ_WRITE mode. + """ + project: Optional[str] = None + """ + The project that the referenced compute instance is a part of. If instance is referenced by its + self_link the project defined in the link will take precedence. + """ + zone: Optional[str] = None + """ + The zone that the referenced compute instance is located within. If instance is referenced by its + self_link the zone defined in the link will take precedence. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class AttachedDisk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['AttachedDisk']] = 'AttachedDisk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + AttachedDiskSpec defines the desired state of AttachedDisk + """ + status: Optional[Status] = None + """ + AttachedDiskStatus defines the observed state of AttachedDisk. + """ + + +class AttachedDiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[AttachedDisk] + """ + List of attacheddisks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/autoscaler/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/autoscaler/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/autoscaler/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/autoscaler/v1beta1.py new file mode 100644 index 000000000..513a26287 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/autoscaler/v1beta1.py @@ -0,0 +1,527 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_autoscaler.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CpuUtilization(BaseModel): + predictiveMethod: Optional[str] = None + """ + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class LoadBalancingUtilization(BaseModel): + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class MetricItem(BaseModel): + filter: Optional[str] = None + """ + A filter string to be used as the filter string for + a Stackdriver Monitoring TimeSeries.list API call. + This filter is used to select a specific TimeSeries for + the purpose of autoscaling and to determine whether the metric + is exporting per-instance or per-group data. + You can only use the AND operator for joining selectors. + You can only use direct equality comparison operator (=) without + any functions for each selector. + You can specify the metric in both the filter string and in the + metric field. However, if specified in both places, the metric must + be identical. + The monitored resource type determines what kind of values are + expected for the metric. If it is a gce_instance, the autoscaler + expects the metric to include a separate TimeSeries for each + instance in a group. In such a case, you cannot filter on resource + labels. + If the resource type is any other value, the autoscaler expects + this metric to contain values that apply to the entire autoscaled + instance group and resource label filtering can be performed to + point autoscaler at the correct TimeSeries to scale upon. + This is called a per-group metric for the purpose of autoscaling. + If not specified, the type defaults to gce_instance. + You should provide a filter that is selective enough to pick just + one TimeSeries for the autoscaled group or for each of the instances + (if you are using gce_instance resource type). If multiple + TimeSeries are returned upon the query execution, the autoscaler + will sum their respective values to obtain its scaling value. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + singleInstanceAssignment: Optional[float] = None + """ + If scaling is based on a per-group metric value that represents the + total amount of work to be done or resource usage, set this value to + an amount assigned for a single instance of the scaled group. + The autoscaler will keep the number of instances proportional to the + value of this metric, the metric itself should not change value due + to group resizing. + For example, a good metric to use with the target is + pubsub.googleapis.com/subscription/num_undelivered_messages + or a custom metric exporting the total number of requests coming to + your instances. + A bad example would be a metric exporting an average or median + latency, since this value can't include a chunk assignable to a + single instance, it could be better used with utilization_target + instead. + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + type: Optional[str] = None + """ + Defines how target utilization value is expressed for a + Stackdriver Monitoring metric. + Possible values are: GAUGE, DELTA_PER_SECOND, DELTA_PER_MINUTE. + """ + + +class MaxScaledInReplicas(BaseModel): + fixed: Optional[float] = None + """ + Specifies a fixed number of VM instances. This must be a positive + integer. + """ + percent: Optional[float] = None + """ + Specifies a percentage of instances between 0 to 100%, inclusive. + For example, specify 80 for 80%. + """ + + +class ScaleInControl(BaseModel): + maxScaledInReplicas: Optional[MaxScaledInReplicas] = None + """ + A nested object resource. + Structure is documented below. + """ + timeWindowSec: Optional[float] = None + """ + How long back autoscaling should look when computing recommendations + to include directives regarding slower scale down, as described above. + """ + + +class ScalingSchedule(BaseModel): + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + disabled: Optional[bool] = None + """ + A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. + """ + durationSec: Optional[float] = None + """ + The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. + """ + minRequiredReplicas: Optional[float] = None + """ + Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + schedule: Optional[str] = None + """ + The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). + """ + timeZone: Optional[str] = None + """ + The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + + +class AutoscalingPolicy(BaseModel): + cooldownPeriod: Optional[float] = None + """ + The number of seconds that the autoscaler should wait before it + starts collecting information from a new instance. This prevents + the autoscaler from collecting information when the instance is + initializing, during which the collected usage would not be + reliable. The default time autoscaler waits is 60 seconds. + Virtual machine initialization times might vary because of + numerous factors. We recommend that you test how long an + instance may take to initialize. To do this, create an instance + and time the startup process. + """ + cpuUtilization: Optional[CpuUtilization] = None + """ + Defines the CPU utilization policy that allows the autoscaler to + scale based on the average CPU utilization of a managed instance + group. + Structure is documented below. + """ + loadBalancingUtilization: Optional[LoadBalancingUtilization] = None + """ + Configuration parameters of autoscaling based on a load balancer. + Structure is documented below. + """ + maxReplicas: Optional[float] = None + """ + The maximum number of instances that the autoscaler can scale up + to. This is required when creating or updating an autoscaler. The + maximum number of replicas should not be lower than minimal number + of replicas. + """ + metric: Optional[List[MetricItem]] = None + """ + Configuration parameters of autoscaling based on a custom metric. + Structure is documented below. + """ + minReplicas: Optional[float] = None + """ + The minimum number of replicas that the autoscaler can scale down + to. This cannot be less than 0. If not provided, autoscaler will + choose a default value depending on maximum number of instances + allowed. + """ + mode: Optional[str] = None + """ + Defines operating mode for this policy. + """ + scaleInControl: Optional[ScaleInControl] = None + """ + Defines scale in controls to reduce the risk of response latency + and outages due to abrupt scale-in events + Structure is documented below. + """ + scalingSchedules: Optional[List[ScalingSchedule]] = None + """ + Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a InstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate target. + """ + zone: str + """ + URL of the zone where the instance group resides. + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a InstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/autoscalers/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + zone: Optional[str] = None + """ + URL of the zone where the instance group resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Autoscaler(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Autoscaler']] = 'Autoscaler' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + AutoscalerSpec defines the desired state of Autoscaler + """ + status: Optional[Status] = None + """ + AutoscalerStatus defines the observed state of Autoscaler. + """ + + +class AutoscalerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Autoscaler] + """ + List of autoscalers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendbucket/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/backendbucket/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendbucket/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/backendbucket/v1beta1.py new file mode 100644 index 000000000..506c7ec47 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/backendbucket/v1beta1.py @@ -0,0 +1,528 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_backendbucket.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BucketNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BucketNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BypassCacheOnRequestHeader(BaseModel): + headerName: Optional[str] = None + """ + The header field name to match on when bypassing cache. Values are case-insensitive. + """ + + +class CacheKeyPolicy(BaseModel): + includeHttpHeaders: Optional[List[str]] = None + """ + Allows HTTP request headers (by name) to be used in the + cache key. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + Default parameters are always included. '&' and '=' will + be percent encoded and not treated as delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + ttl: Optional[float] = None + """ + The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s + (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + """ + + +class CdnPolicy(BaseModel): + bypassCacheOnRequestHeaders: Optional[List[BypassCacheOnRequestHeader]] = None + """ + Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + Structure is documented below. + """ + cacheKeyPolicy: Optional[CacheKeyPolicy] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. When the + cache_mode is set to "USE_ORIGIN_HEADERS", you must omit this field. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). When the cache_mode + is set to "USE_ORIGIN_HEADERS", you must omit this field. + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. When the + cache_mode is set to "USE_ORIGIN_HEADERS", you must omit this field. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + requestCoalescing: Optional[bool] = None + """ + If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request will + be considered fresh. After this time period, + the response will be revalidated before being served. + When serving responses to signed URL requests, + Cloud CDN will internally behave as though + all responses from this backend had a "Cache-Control: public, + max-age=[TTL]" header, regardless of any existing Cache-Control + header. The actual headers served in responses will not be altered. + """ + + +class EdgeSecurityPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EdgeSecurityPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + edgeSecurityPolicyRef: Optional[EdgeSecurityPolicyRef] = None + """ + Reference to a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + edgeSecurityPolicySelector: Optional[EdgeSecurityPolicySelector] = None + """ + Selector for a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + bucketNameRef: Optional[BucketNameRef] = None + """ + Reference to a Bucket in storage to populate bucketName. + """ + bucketNameSelector: Optional[BucketNameSelector] = None + """ + Selector for a Bucket in storage to populate bucketName. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + edgeSecurityPolicyRef: Optional[EdgeSecurityPolicyRef] = None + """ + Reference to a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + edgeSecurityPolicySelector: Optional[EdgeSecurityPolicySelector] = None + """ + Selector for a SecurityPolicy in compute to populate edgeSecurityPolicy. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bucketName: Optional[str] = None + """ + Cloud Storage bucket name. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this Backend Bucket. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied responses. + """ + description: Optional[str] = None + """ + An optional textual description of the resource; provided by the + client when the resource is created. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The security policy associated with this backend bucket. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendBucket. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendBuckets/{{name}} + """ + loadBalancingScheme: Optional[str] = None + """ + The value can only be INTERNAL_MANAGED for cross-region internal layer 7 load balancer. + If loadBalancingScheme is not specified, the backend bucket can be used by classic global external load balancers, or global application external load balancers, or both. + Possible values are: INTERNAL_MANAGED. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendBucket(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendBucket']] = 'BackendBucket' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendBucketSpec defines the desired state of BackendBucket + """ + status: Optional[Status] = None + """ + BackendBucketStatus defines the observed state of BackendBucket. + """ + + +class BackendBucketList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendBucket] + """ + List of backendbuckets. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendbucketsignedurlkey/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/backendbucketsignedurlkey/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendbucketsignedurlkey/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/backendbucketsignedurlkey/v1beta1.py new file mode 100644 index 000000000..b58de3172 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/backendbucketsignedurlkey/v1beta1.py @@ -0,0 +1,304 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_backendbucketsignedurlkey.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendBucketRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendBucketSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class KeyValueSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class ForProvider(BaseModel): + backendBucket: Optional[str] = None + """ + The backend bucket this signed URL key belongs. + """ + backendBucketRef: Optional[BackendBucketRef] = None + """ + Reference to a BackendBucket in compute to populate backendBucket. + """ + backendBucketSelector: Optional[BackendBucketSelector] = None + """ + Selector for a BackendBucket in compute to populate backendBucket. + """ + keyValueSecretRef: Optional[KeyValueSecretRef] = None + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + backendBucket: Optional[str] = None + """ + The backend bucket this signed URL key belongs. + """ + backendBucketRef: Optional[BackendBucketRef] = None + """ + Reference to a BackendBucket in compute to populate backendBucket. + """ + backendBucketSelector: Optional[BackendBucketSelector] = None + """ + Selector for a BackendBucket in compute to populate backendBucket. + """ + keyValueSecretRef: KeyValueSecretRef + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendBucket: Optional[str] = None + """ + The backend bucket this signed URL key belongs. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendBuckets/{{backend_bucket}} + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendBucketSignedURLKey(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendBucketSignedURLKey']] = 'BackendBucketSignedURLKey' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendBucketSignedURLKeySpec defines the desired state of BackendBucketSignedURLKey + """ + status: Optional[Status] = None + """ + BackendBucketSignedURLKeyStatus defines the observed state of BackendBucketSignedURLKey. + """ + + +class BackendBucketSignedURLKeyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendBucketSignedURLKey] + """ + List of backendbucketsignedurlkeys. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendservice/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/backendservice/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendservice/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/backendservice/v1beta1.py new file mode 100644 index 000000000..4fc7f5e47 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/backendservice/v1beta1.py @@ -0,0 +1,1875 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_backendservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CustomMetric(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BackendItem(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + For global HTTP(S) or TCP/SSL load balancing, the default is + UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)), + CUSTOM_METRICS (for HTTP(s)) and CONNECTION (for TCP/SSL). + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + Default value is 1, which means the group will serve up to 100% + of its configured capacity (depending on balancingMode). A + setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetric]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + groupRef: Optional[GroupRef] = None + """ + Reference to a InstanceGroupManager in compute to populate group. + """ + groupSelector: Optional[GroupSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate group. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either + maxConnections or maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. For RATE mode, either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + """ + preference: Optional[str] = None + """ + This field indicates whether this backend should be fully utilized before sending traffic to backends + with default preference. This field cannot be set when loadBalancingScheme is set to 'EXTERNAL'. The possible values are: + """ + + +class BypassCacheOnRequestHeader(BaseModel): + headerName: Optional[str] = None + """ + The header field name to match on when bypassing cache. Values are case-insensitive. + """ + + +class CacheKeyPolicy(BaseModel): + includeHost: Optional[bool] = None + """ + If true requests to different hosts will be cached separately. + """ + includeHttpHeaders: Optional[List[str]] = None + """ + Allows HTTP request headers (by name) to be used in the + cache key. + """ + includeNamedCookies: Optional[List[str]] = None + """ + Names of cookies to include in cache keys. + """ + includeProtocol: Optional[bool] = None + """ + If true, http and https requests will be cached separately. + """ + includeQueryString: Optional[bool] = None + """ + If true, include query string parameters in the cache key + according to query_string_whitelist and + query_string_blacklist. If neither is set, the entire query + string will be included. + If false, the query string will be excluded from the cache + key entirely. + """ + queryStringBlacklist: Optional[List[str]] = None + """ + Names of query string parameters to exclude in cache keys. + All other parameters will be included. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + All other parameters will be excluded. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + ttl: Optional[float] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class CdnPolicy(BaseModel): + bypassCacheOnRequestHeaders: Optional[List[BypassCacheOnRequestHeader]] = None + """ + Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. + The cache is bypassed for all cdnPolicy.cacheMode settings. + Structure is documented below. + """ + cacheKeyPolicy: Optional[CacheKeyPolicy] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + requestCoalescing: Optional[bool] = None + """ + If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests + to the origin. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request + will be considered fresh, defaults to 1hr (3600s). After this + time period, the response will be revalidated before + being served. + When serving responses to signed URL requests, Cloud CDN will + internally behave as though all responses from this backend had a + "Cache-Control: public, max-age=[TTL]" header, regardless of any + existing Cache-Control header. The actual headers served in + responses will not be altered. + """ + + +class CircuitBreakers(BaseModel): + maxConnections: Optional[float] = None + """ + The maximum number of connections to the backend cluster. + Defaults to 1024. + """ + maxPendingRequests: Optional[float] = None + """ + The maximum number of pending requests to the backend cluster. + Defaults to 1024. + """ + maxRequests: Optional[float] = None + """ + The maximum number of parallel requests to the backend cluster. + Defaults to 1024. + """ + maxRequestsPerConnection: Optional[float] = None + """ + Maximum requests for a single backend connection. This parameter + is respected by both the HTTP/1.1 and HTTP/2 implementations. If + not specified, there is no limit. Setting this parameter to 1 + will effectively disable keep alive. + """ + maxRetries: Optional[float] = None + """ + The maximum number of parallel retries to the backend cluster. + Defaults to 3. + """ + + +class Ttl(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class HttpCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ConsistentHash(BaseModel): + httpCookie: Optional[HttpCookie] = None + """ + Hash is based on HTTP Cookie. This field describes a HTTP cookie + that will be used as the hash key for the consistent hash load + balancer. If the cookie is not present, it will be generated. + This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + Structure is documented below. + """ + httpHeaderName: Optional[str] = None + """ + The hash based on the value of the specified header field. + This field is applicable if the sessionAffinity is set to HEADER_FIELD. + """ + minimumRingSize: Optional[float] = None + """ + The minimum number of virtual nodes to use for the hash ring. + Larger ring sizes result in more granular load + distributions. If the number of hosts in the load balancing pool + is larger than the ring size, each host will be assigned a single + virtual node. + Defaults to 1024. + """ + + +class CustomMetricModel(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Oauth2ClientSecretSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class Iap(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + oauth2ClientSecretSecretRef: Optional[Oauth2ClientSecretSecretRef] = None + """ + OAuth2 Client Secret for IAP + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class CustomPolicy(BaseModel): + data: Optional[str] = None + """ + An optional, arbitrary JSON object with configuration data, understood + by a locally installed custom policy implementation. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class PolicyModel(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class LocalityLbPolicy(BaseModel): + customPolicy: Optional[CustomPolicy] = None + """ + The configuration for a custom policy implemented by the user and + deployed with the client. + Structure is documented below. + """ + policy: Optional[PolicyModel] = None + """ + The configuration for a built-in load balancing policy. + Structure is documented below. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Whether to enable logging for the load balancer traffic served by this backend service. + """ + optionalFields: Optional[List[str]] = None + """ + This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" + was set to CUSTOM. Contains a list of optional fields you want to include in the logs. + For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace + For example: orca_load_report, tls.protocol + """ + optionalMode: Optional[str] = None + """ + Specifies the optional logging mode for the load balancer traffic. + Supported values: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + Possible values are: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + """ + sampleRate: Optional[float] = None + """ + This field can only be specified if logging is enabled for this backend service. The value of + the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer + where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. + The default value is 1.0. + """ + + +class MaxStreamDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. + Durations less than one second are represented with a 0 seconds field and a positive nanos field. + Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. (int64 format) + """ + + +class BaseEjectionTime(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class Interval(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class OutlierDetection(BaseModel): + baseEjectionTime: Optional[BaseEjectionTime] = None + """ + The base time that a host is ejected for. The real time is equal to the base + time multiplied by the number of times the host has been ejected. Defaults to + 30000ms or 30s. + Structure is documented below. + """ + consecutiveErrors: Optional[float] = None + """ + Number of errors before a host is ejected from the connection pool. When the + backend host is accessed over HTTP, a 5xx return code qualifies as an error. + Defaults to 5. + """ + consecutiveGatewayFailure: Optional[float] = None + """ + The number of consecutive gateway failures (502, 503, 504 status or connection + errors that are mapped to one of those status codes) before a consecutive + gateway failure ejection occurs. Defaults to 5. + """ + enforcingConsecutiveErrors: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive 5xx. This setting can be used to disable + ejection or to ramp it up slowly. Defaults to 100. + """ + enforcingConsecutiveGatewayFailure: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive gateway failures. This setting can be + used to disable ejection or to ramp it up slowly. Defaults to 0. + """ + enforcingSuccessRate: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through success rate statistics. This setting can be used to + disable ejection or to ramp it up slowly. Defaults to 100. + """ + interval: Optional[Interval] = None + """ + Time interval between ejection sweep analysis. This can result in both new + ejections as well as hosts being returned to service. Defaults to 10 seconds. + Structure is documented below. + """ + maxEjectionPercent: Optional[float] = None + """ + Maximum percentage of hosts in the load balancing pool for the backend service + that can be ejected. Defaults to 10%. + """ + successRateMinimumHosts: Optional[float] = None + """ + The number of hosts in a cluster that must have enough request volume to detect + success rate outliers. If the number of hosts is less than this setting, outlier + detection via success rate statistics is not performed for any host in the + cluster. Defaults to 5. + """ + successRateRequestVolume: Optional[float] = None + """ + The minimum number of total requests that must be collected in one interval (as + defined by the interval duration above) to include this host in success rate + based outlier detection. If the volume is lower than this setting, outlier + detection via success rate statistics is not performed for that host. Defaults + to 100. + """ + successRateStdevFactor: Optional[float] = None + """ + This factor is used to determine the ejection threshold for success rate outlier + ejection. The ejection threshold is the difference between the mean success + rate, and the product of this factor and the standard deviation of the mean + success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided + by a thousand to get a double. That is, if the desired factor is 1.9, the + runtime value should be 1900. Defaults to 1900. + """ + + +class AccessKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class AwsV4Authentication(BaseModel): + accessKeyId: Optional[str] = None + """ + The identifier of an access key used for s3 bucket authentication. + """ + accessKeySecretRef: Optional[AccessKeySecretRef] = None + """ + The access key used for s3 bucket authentication. + Required for updating or creating a backend that uses AWS v4 signature authentication, but will not be returned as part of the configuration when queried with a REST API GET request. + Note: This property is sensitive and will not be displayed in the plan. + """ + accessKeyVersion: Optional[str] = None + """ + The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + """ + originRegion: Optional[str] = None + """ + The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. + For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + """ + + +class SecuritySettings(BaseModel): + awsV4Authentication: Optional[AwsV4Authentication] = None + """ + The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. + Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends. + Structure is documented below. + """ + clientTlsPolicy: Optional[str] = None + """ + ClientTlsPolicy is a resource that specifies how a client should authenticate + connections to backends of a service. This resource itself does not affect + configuration unless it is attached to a backend service resource. + """ + subjectAltNames: Optional[List[str]] = None + """ + A list of alternate names to verify the subject identity in the certificate. + If specified, the client will verify that the server certificate's subject + alt name matches one of the specified values. + """ + + +class StrongSessionAffinityCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class SubjectAltName(BaseModel): + dnsName: Optional[str] = None + """ + The SAN specified as a DNS Name. + """ + uniformResourceIdentifier: Optional[str] = None + """ + The SAN specified as a URI. + """ + + +class TlsSettings(BaseModel): + authenticationConfig: Optional[str] = None + """ + Reference to the BackendAuthenticationConfig resource from the networksecurity.googleapis.com namespace. + Can be used in authenticating TLS connections to the backend, as specified by the authenticationMode field. + Can only be specified if authenticationMode is not NONE. + """ + sni: Optional[str] = None + """ + Server Name Indication - see RFC3546 section 3.1. If set, the load balancer sends this string as the SNI hostname in the + TLS connection to the backend, and requires that this string match a Subject Alternative Name (SAN) in the backend's + server certificate. With a Regional Internet NEG backend, if the SNI is specified here, the load balancer uses it + regardless of whether the Regional Internet NEG is specified with FQDN or IP address and port. + """ + subjectAltNames: Optional[List[SubjectAltName]] = None + """ + A list of Subject Alternative Names (SANs) that the Load Balancer verifies during a TLS handshake with the backend. + When the server presents its X.509 certificate to the Load Balancer, the Load Balancer inspects the certificate's SAN field, + and requires that at least one SAN match one of the subjectAltNames in the list. This field is limited to 5 entries. + When both sni and subjectAltNames are specified, the load balancer matches the backend certificate's SAN only to + subjectAltNames. + Structure is documented below. + """ + + +class ForProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + customMetrics: Optional[List[CustomMetricModel]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[SecuritySettings] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[TlsSettings] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class CustomMetricModel1(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class PolicyModel1(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class CustomMetricModel2(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class PolicyModel2(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class InitProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + customMetrics: Optional[List[CustomMetricModel2]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[SecuritySettings] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[TlsSettings] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CustomMetricModel3(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class BackendItemModel(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + For global HTTP(S) or TCP/SSL load balancing, the default is + UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)), + CUSTOM_METRICS (for HTTP(s)) and CONNECTION (for TCP/SSL). + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + Default value is 1, which means the group will serve up to 100% + of its configured capacity (depending on balancingMode). A + setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetricModel3]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either + maxConnections or maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. This is used to calculate the + capacity of the group. Can be used in either CONNECTION or + UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. For RATE mode, either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + """ + preference: Optional[str] = None + """ + This field indicates whether this backend should be fully utilized before sending traffic to backends + with default preference. This field cannot be set when loadBalancingScheme is set to 'EXTERNAL'. The possible values are: + """ + + +class CustomMetricModel4(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class IapModel(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + + +class AwsV4AuthenticationModel(BaseModel): + accessKeyId: Optional[str] = None + """ + The identifier of an access key used for s3 bucket authentication. + """ + accessKeyVersion: Optional[str] = None + """ + The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + """ + originRegion: Optional[str] = None + """ + The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. + For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + """ + + +class AtProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItemModel]] = None + """ + The set of backends that serve this BackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + compressionMode: Optional[str] = None + """ + Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + Possible values are: AUTOMATIC, DISABLED. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. This field only applies if the load_balancing_scheme is set to + INTERNAL_SELF_MANAGED. This field is only applicable when locality_lb_policy is + set to MAGLEV or RING_HASH. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customMetrics: Optional[List[CustomMetricModel4]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + customRequestHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + requests. + """ + customResponseHeaders: Optional[List[str]] = None + """ + Headers that the HTTP/S load balancer should add to proxied + responses. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeSecurityPolicy: Optional[str] = None + """ + The resource URL for the edge security policy associated with this backend service. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this BackendService. + """ + externalManagedMigrationState: Optional[str] = None + """ + Specifies the canary migration state. Possible values are PREPARE, TEST_BY_PERCENTAGE, and + TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic by percentage using externalManagedMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests that should be processed by the Global external + Application Load Balancer. + The value of this field must be in the range [0, 100]. + Session affinity options will slightly affect this routing behavior, for more details, + see: Session Affinity. + This value can only be set if the loadBalancingScheme in the backend service is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + generatedId: Optional[float] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource + for health checking this BackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + For internal load balancing, a URL to a HealthCheck resource must be specified instead. + """ + iap: Optional[IapModel] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, the Google-managed OAuth client is used. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendServices/{{name}} + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + Indicates whether the backend service will be used with internal or + external load balancing. A backend service created for one type of + load balancing cannot be used with the other. For more information, refer to + Choosing a load balancer. + Default value is EXTERNAL. + Possible values are: EXTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, EXTERNAL_MANAGED. + """ + localityLbPolicies: Optional[List[LocalityLbPolicy]] = None + """ + A list of locality load balancing policies to be used in order of + preference. Either the policy or the customPolicy field should be set. + Overrides any value set in the localityLbPolicy field. + localityLbPolicies is only supported when the BackendService is referenced + by a URL Map that is referenced by a target gRPC proxy that has the + validateForProxyless field set to true. + Structure is documented below. + """ + localityLbPolicy: Optional[str] = None + """ + The load balancing algorithm used within the scope of the locality. + The possible values are: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the + beginning of the stream until the response has been completely processed, including all retries. A stream that + does not complete in this duration is closed. + If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. + This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + Applicable backend service types can be a global backend service with the + loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. + Structure is documented below. + """ + portName: Optional[str] = None + """ + Name of backend port. The same name should appear in the instance + groups referenced by this service. Required when the load balancing + scheme is EXTERNAL. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + The protocol this BackendService uses to communicate with backends. + The default is HTTP. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP + or GRPC. Refer to the documentation for the load balancers or for Traffic Director + for more information. Must be set to GRPC when the backend service is referenced + by a URL map that is bound to target gRPC proxy. + Possible values are: HTTP, HTTPS, HTTP2, TCP, SSL, UDP, GRPC, UNSPECIFIED, H2C. + """ + securityPolicy: Optional[str] = None + """ + The security policy associated with this backend service. + """ + securitySettings: Optional[SecuritySettings] = None + """ + The security settings that apply to this backend service. This field is applicable to either + a regional backend service with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and + load_balancing_scheme set to INTERNAL_MANAGED; or a global backend service with the + load_balancing_scheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceLbPolicy: Optional[str] = None + """ + URL to networkservices.ServiceLbPolicy resource. + Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + tlsSettings: Optional[TlsSettings] = None + """ + Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendService(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendService']] = 'BackendService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendServiceSpec defines the desired state of BackendService + """ + status: Optional[Status] = None + """ + BackendServiceStatus defines the observed state of BackendService. + """ + + +class BackendServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendService] + """ + List of backendservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendservicesignedurlkey/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/backendservicesignedurlkey/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/backendservicesignedurlkey/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/backendservicesignedurlkey/v1beta1.py new file mode 100644 index 000000000..fe0a3287f --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/backendservicesignedurlkey/v1beta1.py @@ -0,0 +1,304 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_backendservicesignedurlkey.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class KeyValueSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + The backend service this signed URL key belongs. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + keyValueSecretRef: Optional[KeyValueSecretRef] = None + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + The backend service this signed URL key belongs. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + keyValueSecretRef: KeyValueSecretRef + """ + 128-bit key value used for signing the URL. The key value must be a + valid RFC 4648 Section 5 base64url encoded string. + Note: This property is sensitive and will not be displayed in the plan. + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + The backend service this signed URL key belongs. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/backendServices/{{backend_service}} + """ + name: Optional[str] = None + """ + Name of the signed URL key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class BackendServiceSignedURLKey(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['BackendServiceSignedURLKey']] = 'BackendServiceSignedURLKey' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + BackendServiceSignedURLKeySpec defines the desired state of BackendServiceSignedURLKey + """ + status: Optional[Status] = None + """ + BackendServiceSignedURLKeyStatus defines the observed state of BackendServiceSignedURLKey. + """ + + +class BackendServiceSignedURLKeyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[BackendServiceSignedURLKey] + """ + List of backendservicesignedurlkeys. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/disk/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/disk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/disk/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/disk/v1beta1.py new file mode 100644 index 000000000..7ee8d251b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/disk/v1beta1.py @@ -0,0 +1,997 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_disk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AsyncPrimaryDisk(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + + +class RawKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class DiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the disk. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class ForProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + zone: str + """ + A reference to the zone where the disk resides. + """ + + +class InitProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsyncPrimaryDiskModel(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + + +class DiskEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to encrypt the disk. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class AtProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + architecture: Optional[str] = None + """ + The architecture of the disk. Values include X86_64, ARM64. + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDiskModel] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKeyModel] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + diskId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/disks/{{name}} + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + lastAttachTimestamp: Optional[str] = None + """ + Last attach timestamp in RFC3339 text format. + """ + lastDetachTimestamp: Optional[str] = None + """ + Last detach timestamp in RFC3339 text format. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much Throughput must be provisioned for the disk. + Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk + allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the image or + snapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with image or snapshot, + the value must not be less than the size of the image + or the size of the snapshot. + You can add lifecycle.prevent_destroy in the config to prevent destroying + and recreating. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. If the snapshot is in another + project than this disk, you must supply a full URL. For example, the + following are valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceDiskId: Optional[str] = None + """ + The ID value of the disk used to create this image. This value may + be used to determine whether the image was taken from the current + or a previous instance of a given disk name. + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceImageId: Optional[str] = None + """ + The ID value of the image used to create this disk. This value + identifies the exact image that was used to create this persistent + disk. For example, if you created the persistent disk from an image + that was later deleted and recreated under the same name, the source + image ID would identify the exact version of the image that was used. + """ + sourceInstantSnapshot: Optional[str] = None + """ + The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceInstantSnapshotId: Optional[str] = None + """ + The unique ID of the instant snapshot used to create this disk. This value identifies + the exact instant snapshot that was used to create this persistent disk. + For example, if you created the persistent disk from an instant snapshot that was later + deleted and recreated under the same name, the source instant snapshot ID would identify + the exact version of the instant snapshot that was used. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceSnapshotId: Optional[str] = None + """ + The unique ID of the snapshot used to create this disk. This value + identifies the exact snapshot that was used to create this persistent + disk. For example, if you created the persistent disk from a snapshot + that was later deleted and recreated under the same name, the source + snapshot ID would identify the exact version of the snapshot that was + used. + """ + sourceStorageObject: Optional[str] = None + """ + The full Google Cloud Storage URI where the disk image is stored. + This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. + Valid URIs may start with gs:// or https://storage.googleapis.com/. + This flag is not optimized for creating multiple disks from a source storage object. + To create many disks from a source storage object, use gcloud compute images import instead. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + users: Optional[List[str]] = None + """ + Links to the users of the disk (attached instances) in form: + project/zones/zone/instances/instance + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Disk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Disk']] = 'Disk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskSpec defines the desired state of Disk + """ + status: Optional[Status] = None + """ + DiskStatus defines the observed state of Disk. + """ + + +class DiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Disk] + """ + List of disks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/diskiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/diskiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/diskiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/diskiammember/v1beta1.py new file mode 100644 index 000000000..2b567695b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/diskiammember/v1beta1.py @@ -0,0 +1,267 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_diskiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a Disk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Disk in compute to populate name. + """ + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a Disk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Disk in compute to populate name. + """ + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class DiskIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['DiskIAMMember']] = 'DiskIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskIAMMemberSpec defines the desired state of DiskIAMMember + """ + status: Optional[Status] = None + """ + DiskIAMMemberStatus defines the observed state of DiskIAMMember. + """ + + +class DiskIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[DiskIAMMember] + """ + List of diskiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/diskresourcepolicyattachment/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/diskresourcepolicyattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/diskresourcepolicyattachment/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/diskresourcepolicyattachment/v1beta1.py new file mode 100644 index 000000000..54e3fa674 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/diskresourcepolicyattachment/v1beta1.py @@ -0,0 +1,352 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_diskresourcepolicyattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class InitProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a Disk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a Disk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the disk in which the resource policies are attached to. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{zone}}/{{disk}}/{{name}} + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class DiskResourcePolicyAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['DiskResourcePolicyAttachment']] = ( + 'DiskResourcePolicyAttachment' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + DiskResourcePolicyAttachmentSpec defines the desired state of DiskResourcePolicyAttachment + """ + status: Optional[Status] = None + """ + DiskResourcePolicyAttachmentStatus defines the observed state of DiskResourcePolicyAttachment. + """ + + +class DiskResourcePolicyAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[DiskResourcePolicyAttachment] + """ + List of diskresourcepolicyattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/externalvpngateway/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/externalvpngateway/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/externalvpngateway/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/externalvpngateway/v1beta1.py new file mode 100644 index 000000000..2cf7ee53f --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/externalvpngateway/v1beta1.py @@ -0,0 +1,291 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_externalvpngateway.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class InterfaceItem(BaseModel): + id: Optional[float] = None + """ + The numeric ID for this interface. Allowed values are based on the redundancy type + of this external VPN gateway + """ + ipAddress: Optional[str] = None + """ + IP address of the interface in the external VPN gateway. + Only IPv4 is supported. This IP address can be either from + your on-premise gateway or another Cloud provider's VPN gateway, + it cannot be an IP address from Google Compute Engine. + """ + ipv6Address: Optional[str] = None + """ + IPv6 address of the interface in the external VPN gateway. This IPv6 + address can be either from your on-premise gateway or another Cloud + provider's VPN gateway, it cannot be an IP address from Google Compute + Engine. Must specify an IPv6 address (not IPV4-mapped) using any format + described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format + is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + interface: Optional[List[InterfaceItem]] = None + """ + A list of interfaces on this external VPN gateway. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for the external VPN gateway resource. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + redundancyType: Optional[str] = None + """ + Indicates the redundancy type of this external VPN gateway + Possible values are: FOUR_IPS_REDUNDANCY, SINGLE_IP_INTERNALLY_REDUNDANT, TWO_IPS_REDUNDANCY. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + interface: Optional[List[InterfaceItem]] = None + """ + A list of interfaces on this external VPN gateway. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for the external VPN gateway resource. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + redundancyType: Optional[str] = None + """ + Indicates the redundancy type of this external VPN gateway + Possible values are: FOUR_IPS_REDUNDANCY, SINGLE_IP_INTERNALLY_REDUNDANT, TWO_IPS_REDUNDANCY. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/externalVpnGateways/{{name}} + """ + interface: Optional[List[InterfaceItem]] = None + """ + A list of interfaces on this external VPN gateway. + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for the external VPN gateway resource. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + redundancyType: Optional[str] = None + """ + Indicates the redundancy type of this external VPN gateway + Possible values are: FOUR_IPS_REDUNDANCY, SINGLE_IP_INTERNALLY_REDUNDANT, TWO_IPS_REDUNDANCY. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ExternalVPNGateway(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ExternalVPNGateway']] = 'ExternalVPNGateway' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ExternalVPNGatewaySpec defines the desired state of ExternalVPNGateway + """ + status: Optional[Status] = None + """ + ExternalVPNGatewayStatus defines the observed state of ExternalVPNGateway. + """ + + +class ExternalVPNGatewayList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ExternalVPNGateway] + """ + List of externalvpngateways. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewall/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/firewall/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewall/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/firewall/v1beta1.py new file mode 100644 index 000000000..d902218ef --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/firewall/v1beta1.py @@ -0,0 +1,695 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_firewall.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AllowItem(BaseModel): + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field + is only applicable for UDP or TCP protocol. Each entry must be + either an integer or a range. If not specified, this rule + applies to connections through any port. + Example inputs include: [22], [80, 443], and + ["12345-12349"]. + """ + protocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is + required when creating a firewall rule. This value can either be + one of the following well known protocol strings (tcp, udp, + icmp, esp, ah, sctp, ipip, all), or the IP protocol number. + """ + + +class DenyItem(BaseModel): + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field + is only applicable for UDP or TCP protocol. Each entry must be + either an integer or a range. If not specified, this rule + applies to connections through any port. + Example inputs include: [22], [80, 443], and + ["12345-12349"]. + """ + protocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is + required when creating a firewall rule. This value can either be + one of the following well known protocol strings (tcp, udp, + icmp, esp, ah, sctp, ipip, all), or the IP protocol number. + """ + + +class LogConfig(BaseModel): + metadata: Optional[str] = None + """ + This field denotes whether to include or exclude metadata for firewall logs. + Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the firewall. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class ForProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class InitProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + allow: Optional[List[AllowItem]] = None + """ + The list of ALLOW rules specified by this firewall. Each rule + specifies a protocol and port-range tuple that describes a permitted + connection. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + deny: Optional[List[DenyItem]] = None + """ + The list of DENY rules specified by this firewall. Each rule specifies + a protocol and port-range tuple that describes a denied connection. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + destinationRanges: Optional[List[str]] = None + """ + If destination ranges are specified, the firewall will apply only to + traffic that has destination IP address in these ranges. These ranges + must be expressed in CIDR format. IPv4 or IPv6 ranges are supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to which this firewall applies; default is + INGRESS. Note: For INGRESS traffic, one of source_ranges, + source_tags or source_service_accounts is required. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall rule is disabled, i.e not applied to the + network it is associated with. When set to true, the firewall rule is + not enforced and the network behaves as if it did not exist. If this + is unspecified, the firewall rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + This field denotes whether to enable logging for a particular firewall rule. + If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewalls/{{name}} + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for a particular firewall rule. + If defined, logging is enabled, and logs will be exported to Cloud Logging. + Structure is documented below. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this firewall to. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + Priority for this rule. This is an integer between 0 and 65535, both + inclusive. When not specified, the value assumed is 1000. Relative + priorities determine precedence of conflicting rules. Lower value of + priority implies higher precedence (eg, a rule with priority 0 has + higher precedence than a rule with priority 1). DENY rules take + precedence over ALLOW rules having equal priority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sourceRanges: Optional[List[str]] = None + """ + If source ranges are specified, the firewall will apply only to + traffic that has source IP address in these ranges. These ranges must + be expressed in CIDR format. One or both of sourceRanges and + sourceTags may be set. If both properties are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP that belongs to a tag listed in the sourceTags property. The + connection does not need to match both properties for the firewall to + apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of + source_ranges, source_tags or source_service_accounts is required. + """ + sourceServiceAccounts: Optional[List[str]] = None + """ + If source service accounts are specified, the firewall will apply only + to traffic originating from an instance with a service account in this + list. Source service accounts cannot be used to control traffic to an + instance's external IP address because service accounts are associated + with an instance, not an IP address. sourceRanges can be set at the + same time as sourceServiceAccounts. If both are set, the firewall will + apply to traffic that has source IP address within sourceRanges OR the + source IP belongs to an instance with service account listed in + sourceServiceAccount. The connection does not need to match both + properties for the firewall to apply. sourceServiceAccounts cannot be + used at the same time as sourceTags or targetTags. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + sourceTags: Optional[List[str]] = None + """ + If source tags are specified, the firewall will apply only to traffic + with source IP that belongs to a tag listed in source tags. Source + tags cannot be used to control traffic to an instance's external IP + address. Because tags are associated with an instance, not an IP + address. One or both of sourceRanges and sourceTags may be set. If + both properties are set, the firewall will apply to traffic that has + source IP address within sourceRanges OR the source IP that belongs to + a tag listed in the sourceTags property. The connection does not need + to match both properties for the firewall to apply. For INGRESS traffic, + one of source_ranges, source_tags or source_service_accounts is required. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + targetServiceAccounts cannot be used at the same time as targetTags or + sourceTags. If neither targetServiceAccounts nor targetTags are + specified, the firewall rule applies to all instances on the specified + network. + """ + targetTags: Optional[List[str]] = None + """ + A list of instance tags indicating sets of instances located in the + network that may make network connections as specified in allowed[]. + If no targetTags are specified, the firewall rule applies to all + instances on the specified network. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Firewall(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Firewall']] = 'Firewall' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallSpec defines the desired state of Firewall + """ + status: Optional[Status] = None + """ + FirewallStatus defines the observed state of Firewall. + """ + + +class FirewallList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Firewall] + """ + List of firewalls. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicy/v1beta1.py new file mode 100644 index 000000000..ce8f5ed45 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicy/v1beta1.py @@ -0,0 +1,247 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_firewallpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + parent: Optional[str] = None + """ + The parent of the firewall policy. + """ + shortName: Optional[str] = None + """ + User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. + This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. The name must be 1-63 characters long, and comply with RFC1035. + Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + parent: Optional[str] = None + """ + The parent of the firewall policy. + """ + shortName: Optional[str] = None + """ + User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. + This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. The name must be 1-63 characters long, and comply with RFC1035. + Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of the resource. This field is used internally during updates of this resource. + """ + firewallPolicyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format locations/global/firewallPolicies/{{name}} + """ + name: Optional[str] = None + """ + Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy. + """ + parent: Optional[str] = None + """ + The parent of the firewall policy. + """ + ruleTupleCount: Optional[float] = None + """ + Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + shortName: Optional[str] = None + """ + User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. + This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. The name must be 1-63 characters long, and comply with RFC1035. + Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FirewallPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['FirewallPolicy']] = 'FirewallPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallPolicySpec defines the desired state of FirewallPolicy + """ + status: Optional[Status] = None + """ + FirewallPolicyStatus defines the observed state of FirewallPolicy. + """ + + +class FirewallPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FirewallPolicy] + """ + List of firewallpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyassociation/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyassociation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyassociation/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyassociation/v1beta1.py new file mode 100644 index 000000000..b225fb999 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyassociation/v1beta1.py @@ -0,0 +1,348 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_firewallpolicyassociation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class AttachmentTargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class AttachmentTargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Folder in cloudplatform to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Folder in cloudplatform to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + This field can be updated to refer to a different Firewall Policy, which will create a new association from that new + firewall policy with the flag to override the existing attachmentTarget's policy association. + Note Due to potential risks with this operation it is highly recommended to use the create_before_destroy life cycle option + on your exisiting firewall policy so as to prevent a situation where your attachment target has no associated policy. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + name: Optional[str] = None + """ + The name for an association. + """ + + +class InitProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Folder in cloudplatform to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Folder in cloudplatform to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + This field can be updated to refer to a different Firewall Policy, which will create a new association from that new + firewall policy with the flag to override the existing attachmentTarget's policy association. + Note Due to potential risks with this operation it is highly recommended to use the create_before_destroy life cycle option + on your exisiting firewall policy so as to prevent a situation where your attachment target has no associated policy. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + name: Optional[str] = None + """ + The name for an association. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + This field can be updated to refer to a different Firewall Policy, which will create a new association from that new + firewall policy with the flag to override the existing attachmentTarget's policy association. + Note Due to potential risks with this operation it is highly recommended to use the create_before_destroy life cycle option + on your exisiting firewall policy so as to prevent a situation where your attachment target has no associated policy. + """ + id: Optional[str] = None + """ + an identifier for the resource with format locations/global/firewallPolicies/{{firewall_policy}}/associations/{{name}} + """ + name: Optional[str] = None + """ + The name for an association. + """ + shortName: Optional[str] = None + """ + The short name of the firewall policy of the association. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FirewallPolicyAssociation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['FirewallPolicyAssociation']] = 'FirewallPolicyAssociation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallPolicyAssociationSpec defines the desired state of FirewallPolicyAssociation + """ + status: Optional[Status] = None + """ + FirewallPolicyAssociationStatus defines the observed state of FirewallPolicyAssociation. + """ + + +class FirewallPolicyAssociationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FirewallPolicyAssociation] + """ + List of firewallpolicyassociations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyrule/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyrule/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyrule/v1beta1.py new file mode 100644 index 000000000..bdd931486 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/firewallpolicyrule/v1beta1.py @@ -0,0 +1,714 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_firewallpolicyrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DestAddressGroupsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DestAddressGroupsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Layer4Config(BaseModel): + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. + This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + """ + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SrcSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class Match(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destAddressGroupsRefs: Optional[List[DestAddressGroupsRef]] = None + """ + References to AddressGroup in networksecurity to populate destAddressGroups. + """ + destAddressGroupsSelector: Optional[DestAddressGroupsSelector] = None + """ + Selector for a list of AddressGroup in networksecurity to populate destAddressGroups. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTag]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class ForProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. + This field allows you to control which network's VMs get this rule. + If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class InitProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a FirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a FirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. + This field allows you to control which network's VMs get this rule. + If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SrcSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class MatchModel(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTagModel]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class AtProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}} + """ + kind: Optional[str] = None + """ + Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + """ + match: Optional[MatchModel] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + ruleTupleCount: Optional[float] = None + """ + Calculation of the complexity of a single firewall policy rule. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetResources: Optional[List[str]] = None + """ + A list of network resource URLs to which this rule applies. + This field allows you to control which network's VMs get this rule. + If this field is left blank, all VMs within the organization will receive the rule. + """ + targetSecureTags: Optional[List[TargetSecureTagModel]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target secure tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class FirewallPolicyRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['FirewallPolicyRule']] = 'FirewallPolicyRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + FirewallPolicyRuleSpec defines the desired state of FirewallPolicyRule + """ + status: Optional[Status] = None + """ + FirewallPolicyRuleStatus defines the observed state of FirewallPolicyRule. + """ + + +class FirewallPolicyRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[FirewallPolicyRule] + """ + List of firewallpolicyrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/forwardingrule/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/forwardingrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/forwardingrule/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/forwardingrule/v1beta1.py new file mode 100644 index 000000000..64b17f8ad --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/forwardingrule/v1beta1.py @@ -0,0 +1,1062 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_forwardingrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class IpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceDirectoryRegistrations(BaseModel): + namespace: Optional[str] = None + """ + Service Directory namespace to register the forwarding rule under. + """ + service: Optional[str] = None + """ + Service Directory service to register the forwarding rule under. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a Address in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a Address in compute to populate ipAddress. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + Note that an empty string value ("") is also supported for some use + cases, for example PSC (private service connection) regional forwarding + rules. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + region: str + """ + A reference to the region where the regional forwarding rule resides. + This field is not applicable to global forwarding rules. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionTargetHTTPProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionTargetHTTPProxy in compute to populate target. + """ + + +class InitProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a Address in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a Address in compute to populate ipAddress. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + Note that an empty string value ("") is also supported for some use + cases, for example PSC (private service connection) regional forwarding + rules. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionTargetHTTPProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionTargetHTTPProxy in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + allPorts: Optional[bool] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The allPorts field has the following limitations: + """ + allowGlobalAccess: Optional[bool] = None + """ + This field is used along with the backend_service field for + internal load balancing or with the target field for internal + TargetInstance. + If the field is set to TRUE, clients can access ILB from all + regions. + Otherwise only allows access from clients in the same region as the + internal load balancer. + """ + allowPscGlobalAccess: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + """ + backendService: Optional[str] = None + """ + Identifies the backend service to which the forwarding rule sends traffic. + Required for Internal TCP/UDP Load Balancing and Network Load Balancing; + must be omitted for all other load balancer types. + """ + baseForwardingRule: Optional[str] = None + """ + [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + forwardingRuleId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/forwardingRules/{{name}} + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target or backendService. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + A Forwarding Rule with protocol L3_DEFAULT can attach with target instance or + backend service with UNSPECIFIED protocol. + A forwarding rule with "L3_DEFAULT" IPProtocal cannot be attached to a backend service with TCP or UDP. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP, L3_DEFAULT. + """ + ipVersion: Optional[str] = None + """ + The IP address version that will be used by this forwarding rule. + Valid options are IPV4 and IPV6. + If not set, the IPv4 address will be used by default. + Possible values are: IPV4, IPV6. + """ + isMirroringCollector: Optional[bool] = None + """ + Indicates whether or not this load balancer can be used as a collector for + packet mirroring. To prevent mirroring loops, instances behind this + load balancer will not have their traffic mirrored even if a + PacketMirroring rule applies to them. + This can only be set to true for load balancers that have their + loadBalancingScheme set to INTERNAL. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + Note that an empty string value ("") is also supported for some use + cases, for example PSC (private service connection) regional forwarding + rules. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The portRange field has the following limitations: + """ + ports: Optional[List[str]] = None + """ + The ports, portRange, and allPorts fields are mutually exclusive. + Only packets addressed to ports in the specified range will be forwarded + to the backends configured with this forwarding rule. + The ports field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscConnectionId: Optional[str] = None + """ + The PSC connection id of the PSC Forwarding Rule. + """ + pscConnectionStatus: Optional[str] = None + """ + The PSC connection status of the PSC Forwarding Rule. Possible values: STATUS_UNSPECIFIED, PENDING, ACCEPTED, REJECTED, CLOSED + """ + recreateClosedPsc: Optional[bool] = None + """ + this is used in psc consumer forwardingrule to make provider recreate the forwardingrule when the status is closed + """ + region: Optional[str] = None + """ + A reference to the region where the regional forwarding rule resides. + This field is not applicable to global forwarding rules. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + serviceLabel: Optional[str] = None + """ + An optional prefix to the service name for this Forwarding Rule. + If specified, will be the first label of the fully qualified service + name. + The label must be 1-63 characters long, and comply with RFC1035. + Specifically, the label must be 1-63 characters long and match the + regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters + must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + This field is only used for INTERNAL load balancing. + """ + serviceName: Optional[str] = None + """ + The internal fully qualified service name for this Forwarding Rule. + This field is only used for INTERNAL load balancing. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + target: Optional[str] = None + """ + is set to targetGrpcProxy and + validateForProxyless is set to true, the + IPAddress should be set to 0.0.0.0. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ForwardingRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ForwardingRule']] = 'ForwardingRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ForwardingRuleSpec defines the desired state of ForwardingRule + """ + status: Optional[Status] = None + """ + ForwardingRuleStatus defines the observed state of ForwardingRule. + """ + + +class ForwardingRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ForwardingRule] + """ + List of forwardingrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globaladdress/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/globaladdress/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globaladdress/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/globaladdress/v1beta1.py new file mode 100644 index 000000000..7c23d19ed --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/globaladdress/v1beta1.py @@ -0,0 +1,405 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_globaladdress.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + address: Optional[str] = None + """ + The IP address or beginning of the address range represented by this + resource. This can be supplied as an input to reserve a specific + address or omitted to allow GCP to choose a valid one for you. + """ + addressType: Optional[str] = None + """ + The type of the address to reserve. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the IP range. The IP range + must be in RFC1918 space. The network cannot be deleted if there are + any reserved IP ranges referring to it. + This should only be set when using an Internal address. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + prefixLength: Optional[float] = None + """ + The prefix length of the IP range. If not present, it means the + address field is a single IP address. + This field is not applicable to addresses with addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. Possible values include: + """ + + +class InitProvider(BaseModel): + address: Optional[str] = None + """ + The IP address or beginning of the address range represented by this + resource. This can be supplied as an input to reserve a specific + address or omitted to allow GCP to choose a valid one for you. + """ + addressType: Optional[str] = None + """ + The type of the address to reserve. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the IP range. The IP range + must be in RFC1918 space. The network cannot be deleted if there are + any reserved IP ranges referring to it. + This should only be set when using an Internal address. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + prefixLength: Optional[float] = None + """ + The prefix length of the IP range. If not present, it means the + address field is a single IP address. + This field is not applicable to addresses with addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. Possible values include: + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + address: Optional[str] = None + """ + The IP address or beginning of the address range represented by this + resource. This can be supplied as an input to reserve a specific + address or omitted to allow GCP to choose a valid one for you. + """ + addressType: Optional[str] = None + """ + The type of the address to reserve. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/addresses/{{name}} + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this address. The default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this address. A list of key->value pairs. + """ + network: Optional[str] = None + """ + The URL of the network in which to reserve the IP range. The IP range + must be in RFC1918 space. The network cannot be deleted if there are + any reserved IP ranges referring to it. + This should only be set when using an Internal address. + """ + prefixLength: Optional[float] = None + """ + The prefix length of the IP range. If not present, it means the + address field is a single IP address. + This field is not applicable to addresses with addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. Possible values include: + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalAddress(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalAddress']] = 'GlobalAddress' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalAddressSpec defines the desired state of GlobalAddress + """ + status: Optional[Status] = None + """ + GlobalAddressStatus defines the observed state of GlobalAddress. + """ + + +class GlobalAddressList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalAddress] + """ + List of globaladdresses. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globalforwardingrule/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/globalforwardingrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globalforwardingrule/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/globalforwardingrule/v1beta1.py new file mode 100644 index 000000000..31dc84c37 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/globalforwardingrule/v1beta1.py @@ -0,0 +1,980 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_globalforwardingrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class IpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + Name of the resource; provided by the client when the resource is created. + The name must be 1-63 characters long, and comply with + RFC1035. + Specifically, the name must be 1-63 characters long and match the regular + expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + character must be a lowercase letter, and all following characters must + be a dash, lowercase letter, or digit, except the last character, which + cannot be a dash. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, the forwarding rule name must be a 1-20 characters string with + lowercase letters and numbers and must start with a letter. + """ + value: Optional[str] = None + """ + The value that the label must match. The value has a maximum + length of 1024 characters. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the + provided metadata based on filterMatchCriteria + This list must not be empty and can have at the most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of + filterLabels contribute towards the overall metadataFilter match. + MATCH_ANY - At least one of the filterLabels must have a matching + label in the provided metadata. + MATCH_ALL - All filterLabels must have matching labels in the + provided metadata. + Possible values are: MATCH_ANY, MATCH_ALL. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceDirectoryRegistrations(BaseModel): + namespace: Optional[str] = None + """ + Service Directory namespace to register the forwarding rule under. + """ + serviceDirectoryRegion: Optional[str] = None + """ + [Optional] Service Directory region to register this global forwarding rule under. + Default to "us-central1". Only used for PSC for Google APIs. All PSC for + Google APIs Forwarding Rules on the same network should use the same Service + Directory region. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a GlobalAddress in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a GlobalAddress in compute to populate ipAddress. + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Network in compute to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Network in compute to populate project. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a TargetSSLProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a TargetSSLProxy in compute to populate target. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipAddressRef: Optional[IpAddressRef] = None + """ + Reference to a GlobalAddress in compute to populate ipAddress. + """ + ipAddressSelector: Optional[IpAddressSelector] = None + """ + Selector for a GlobalAddress in compute to populate ipAddress. + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Network in compute to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Network in compute to populate project. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a TargetSSLProxy in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a TargetSSLProxy in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + baseForwardingRule: Optional[str] = None + """ + [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + externalManagedBackendBucketMigrationState: Optional[str] = None + """ + Specifies the canary migration state for the backend buckets attached to this forwarding rule. + Possible values are PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. + To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate + traffic to backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in reverse order. So changing the + scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC at + the same time. Optionally, the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL. + Possible values are: PREPARE, TEST_BY_PERCENTAGE, TEST_ALL_TRAFFIC. + """ + externalManagedBackendBucketMigrationTestingPercentage: Optional[float] = None + """ + Determines the fraction of requests to backend buckets that should be processed by the Global + external Application Load Balancer. + The value of this field must be in the range [0, 100]. + This value can only be set if the loadBalancingScheme in the forwarding rule is set to + EXTERNAL (when using the Classic ALB) and the migration state is TEST_BY_PERCENTAGE. + """ + forwardingRuleId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/forwardingRules/{{name}} + """ + ipAddress: Optional[str] = None + """ + IP address for which this forwarding rule accepts traffic. When a client + sends traffic to this IP address, the forwarding rule directs the traffic + to the referenced target. + While creating a forwarding rule, specifying an IPAddress is + required under the following circumstances: + """ + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. + For protocol forwarding, valid + options are TCP, UDP, ESP, + AH, SCTP, ICMP and + L3_DEFAULT. + The valid IP protocols are different for different load balancing products + as described in Load balancing + features. + Possible values are: TCP, UDP, ESP, AH, SCTP, ICMP. + """ + ipVersion: Optional[str] = None + """ + The IP Version that will be used by this global forwarding rule. + Possible values are: IPV4, IPV6. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this forwarding rule. A list of key->value pairs. + """ + loadBalancingScheme: Optional[str] = None + """ + Specifies the forwarding rule type. + For more information about forwarding rules, refer to + Forwarding rule concepts. + Default value is EXTERNAL. + Possible values are: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing + configuration to a limited set xDS compliant clients. In their xDS + requests to Loadbalancer, xDS clients present node metadata. If a + match takes place, the relevant routing configuration is made available + to those proxies. + For each metadataFilter in this list, if its filterMatchCriteria is set + to MATCH_ANY, at least one of the filterLabels must match the + corresponding label provided in the metadata. If its filterMatchCriteria + is set to MATCH_ALL, then all of its filterLabels must match with + corresponding labels in the provided metadata. + metadataFilters specified here can be overridden by those specified in + the UrlMap that this ForwardingRule references. + metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + network: Optional[str] = None + """ + This field is not used for external load balancing. + For Internal TCP/UDP Load Balancing, this field identifies the network that + the load balanced IP should belong to for this Forwarding Rule. + If the subnetwork is specified, the network of the subnetwork will be used. + If neither subnetwork nor this field is specified, the default network will + be used. + For Private Service Connect forwarding rules that forward traffic to Google + APIs, a network must be provided. + """ + networkTier: Optional[str] = None + """ + This signifies the networking tier used for configuring + this load balancer and can only take the following values: + PREMIUM, STANDARD. + For regional ForwardingRule, the valid values are PREMIUM and + STANDARD. For GlobalForwardingRule, the valid value is + PREMIUM. + If this field is not specified, it is assumed to be PREMIUM. + If IPAddress is specified, this value must be equal to the + networkTier of the Address. + Possible values are: PREMIUM, STANDARD. + """ + noAutomateDnsZone: Optional[bool] = None + """ + This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. + """ + portRange: Optional[str] = None + """ + The portRange field has the following limitations: + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscConnectionId: Optional[str] = None + """ + The PSC connection id of the PSC Forwarding Rule. + """ + pscConnectionStatus: Optional[str] = None + """ + The PSC connection status of the PSC Forwarding Rule. Possible values: STATUS_UNSPECIFIED, PENDING, ACCEPTED, REJECTED, CLOSED + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceDirectoryRegistrations: Optional[ServiceDirectoryRegistrations] = None + """ + Service Directory resources to register this forwarding rule with. + Currently, only supports a single Service Directory resource. + Structure is documented below. + """ + sourceIpRanges: Optional[List[str]] = None + """ + If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each sourceIpRange entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + """ + subnetwork: Optional[str] = None + """ + This field identifies the subnetwork that the load balanced IP should + belong to for this Forwarding Rule, used in internal load balancing and + network load balancing with IPv6. + If the network specified is in auto subnet mode, this field is optional. + However, a subnetwork must be specified if the network is in custom subnet + mode or when creating external forwarding rule with IPv6. + """ + target: Optional[str] = None + """ + The URL of the target resource to receive the matched traffic. For + regional forwarding rules, this target must be in the same region as the + forwarding rule. For global forwarding rules, this target must be a global + load balancing resource. + The forwarded traffic must be of a type appropriate to the target object. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalForwardingRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalForwardingRule']] = 'GlobalForwardingRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalForwardingRuleSpec defines the desired state of GlobalForwardingRule + """ + status: Optional[Status] = None + """ + GlobalForwardingRuleStatus defines the observed state of GlobalForwardingRule. + """ + + +class GlobalForwardingRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalForwardingRule] + """ + List of globalforwardingrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpoint/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpoint/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpoint/v1beta1.py new file mode 100644 index 000000000..6bffffc63 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpoint/v1beta1.py @@ -0,0 +1,315 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_globalnetworkendpoint.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GlobalNetworkEndpointGroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GlobalNetworkEndpointGroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + globalNetworkEndpointGroup: Optional[str] = None + """ + The global network endpoint group this endpoint is part of. + """ + globalNetworkEndpointGroupRef: Optional[GlobalNetworkEndpointGroupRef] = None + """ + Reference to a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + globalNetworkEndpointGroupSelector: Optional[GlobalNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + """ + port: Optional[float] = None + """ + Port number of the external endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + globalNetworkEndpointGroup: Optional[str] = None + """ + The global network endpoint group this endpoint is part of. + """ + globalNetworkEndpointGroupRef: Optional[GlobalNetworkEndpointGroupRef] = None + """ + Reference to a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + globalNetworkEndpointGroupSelector: Optional[GlobalNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a GlobalNetworkEndpointGroup in compute to populate globalNetworkEndpointGroup. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + """ + port: Optional[float] = None + """ + Port number of the external endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + globalNetworkEndpointGroup: Optional[str] = None + """ + The global network endpoint group this endpoint is part of. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + """ + port: Optional[float] = None + """ + Port number of the external endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalNetworkEndpoint(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalNetworkEndpoint']] = 'GlobalNetworkEndpoint' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalNetworkEndpointSpec defines the desired state of GlobalNetworkEndpoint + """ + status: Optional[Status] = None + """ + GlobalNetworkEndpointStatus defines the observed state of GlobalNetworkEndpoint. + """ + + +class GlobalNetworkEndpointList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalNetworkEndpoint] + """ + List of globalnetworkendpoints. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpointgroup/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpointgroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpointgroup/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpointgroup/v1beta1.py new file mode 100644 index 000000000..6d32bdf13 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/globalnetworkendpointgroup/v1beta1.py @@ -0,0 +1,241 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_globalnetworkendpointgroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + Possible values are: INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + Possible values are: INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/networkEndpointGroups/{{name}} + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + Possible values are: INTERNET_IP_PORT, INTERNET_FQDN_PORT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class GlobalNetworkEndpointGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['GlobalNetworkEndpointGroup']] = 'GlobalNetworkEndpointGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + GlobalNetworkEndpointGroupSpec defines the desired state of GlobalNetworkEndpointGroup + """ + status: Optional[Status] = None + """ + GlobalNetworkEndpointGroupStatus defines the observed state of GlobalNetworkEndpointGroup. + """ + + +class GlobalNetworkEndpointGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[GlobalNetworkEndpointGroup] + """ + List of globalnetworkendpointgroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/havpngateway/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/havpngateway/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/havpngateway/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/havpngateway/v1beta1.py new file mode 100644 index 000000000..784637d61 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/havpngateway/v1beta1.py @@ -0,0 +1,462 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_havpngateway.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class InterconnectAttachmentRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InterconnectAttachmentSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class VpnInterface(BaseModel): + id: Optional[float] = None + """ + The numeric ID of this VPN gateway interface. + """ + interconnectAttachment: Optional[str] = None + """ + URL of the interconnect attachment resource. When the value + of this field is present, the VPN Gateway will be used for + IPsec-encrypted Cloud Interconnect; all Egress or Ingress + traffic for this VPN Gateway interface will go through the + specified interconnect attachment resource. + Not currently available publicly. + """ + interconnectAttachmentRef: Optional[InterconnectAttachmentRef] = None + """ + Reference to a InterconnectAttachment in compute to populate interconnectAttachment. + """ + interconnectAttachmentSelector: Optional[InterconnectAttachmentSelector] = None + """ + Selector for a InterconnectAttachment in compute to populate interconnectAttachment. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + gatewayIpVersion: Optional[str] = None + """ + The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + Default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels method. + Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The region this gateway should sit in. + """ + stackType: Optional[str] = None + """ + The stack type for this VPN gateway to identify the IP protocols that are enabled. + If not specified, IPV4_ONLY will be used. + Default value is IPV4_ONLY. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + vpnInterfaces: Optional[List[VpnInterface]] = None + """ + A list of interfaces on this VPN gateway. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + gatewayIpVersion: Optional[str] = None + """ + The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + Default value is IPV4. + Possible values are: IPV4, IPV6. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels method. + Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + stackType: Optional[str] = None + """ + The stack type for this VPN gateway to identify the IP protocols that are enabled. + If not specified, IPV4_ONLY will be used. + Default value is IPV4_ONLY. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + vpnInterfaces: Optional[List[VpnInterface]] = None + """ + A list of interfaces on this VPN gateway. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class VpnInterfaceModel(BaseModel): + id: Optional[float] = None + """ + The numeric ID of this VPN gateway interface. + """ + interconnectAttachment: Optional[str] = None + """ + URL of the interconnect attachment resource. When the value + of this field is present, the VPN Gateway will be used for + IPsec-encrypted Cloud Interconnect; all Egress or Ingress + traffic for this VPN Gateway interface will go through the + specified interconnect attachment resource. + Not currently available publicly. + """ + ipAddress: Optional[str] = None + """ + (Output) + The external IP address for this VPN gateway interface. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + gatewayIpVersion: Optional[str] = None + """ + The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + Default value is IPV4. + Possible values are: IPV4, IPV6. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/vpnGateways/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash + of the labels set used for optimistic locking. The fingerprint is initially generated by + Compute Engine and changes after every request to modify or update labels. + You must always provide an up-to-date fingerprint hash in order to update or change labels, + otherwise the request will fail with error 412 conditionNotMet. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels method. + Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region this gateway should sit in. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + stackType: Optional[str] = None + """ + The stack type for this VPN gateway to identify the IP protocols that are enabled. + If not specified, IPV4_ONLY will be used. + Default value is IPV4_ONLY. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + vpnInterfaces: Optional[List[VpnInterfaceModel]] = None + """ + A list of interfaces on this VPN gateway. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HaVPNGateway(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['HaVPNGateway']] = 'HaVPNGateway' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HaVPNGatewaySpec defines the desired state of HaVPNGateway + """ + status: Optional[Status] = None + """ + HaVPNGatewayStatus defines the observed state of HaVPNGateway. + """ + + +class HaVPNGatewayList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HaVPNGateway] + """ + List of havpngateways. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/healthcheck/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/healthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/healthcheck/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/healthcheck/v1beta1.py new file mode 100644 index 000000000..e2ea20d75 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/healthcheck/v1beta1.py @@ -0,0 +1,648 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_healthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class GrpcHealthCheck(BaseModel): + grpcServiceName: Optional[str] = None + """ + The gRPC service name for the health check. + The value of grpcServiceName has the following meanings by convention: + """ + port: Optional[float] = None + """ + The port number for the health check request. + Must be specified if portName and portSpecification are not set + or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + + +class Http2HealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP2 health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP2 health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP2 health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpsHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. This is false by default, + which means no health check logging will be done. + """ + + +class SslHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the SSL health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the SSL connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class TcpHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the TCP health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the TCP connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/healthChecks/{{name}} + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sourceRegions: Optional[List[str]] = None + """ + The list of cloud regions from which health checks are performed. If + any regions are specified, then exactly 3 regions should be specified. + The region names must be valid names of Google Cloud regions. This can + only be set for global health check. If this list is non-empty, then + there are restrictions on what other health check fields are supported + and what other resources can use this health check: + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + type: Optional[str] = None + """ + The type of the health check. One of HTTP, HTTPS, TCP, or SSL. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['HealthCheck']] = 'HealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HealthCheckSpec defines the desired state of HealthCheck + """ + status: Optional[Status] = None + """ + HealthCheckStatus defines the observed state of HealthCheck. + """ + + +class HealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HealthCheck] + """ + List of healthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/httphealthcheck/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/httphealthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/httphealthcheck/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/httphealthcheck/v1beta1.py new file mode 100644 index 000000000..4081fba6c --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/httphealthcheck/v1beta1.py @@ -0,0 +1,326 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_httphealthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/httpHealthChecks/{{name}} + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HTTPHealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['HTTPHealthCheck']] = 'HTTPHealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HTTPHealthCheckSpec defines the desired state of HTTPHealthCheck + """ + status: Optional[Status] = None + """ + HTTPHealthCheckStatus defines the observed state of HTTPHealthCheck. + """ + + +class HTTPHealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HTTPHealthCheck] + """ + List of httphealthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/httpshealthcheck/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/httpshealthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/httpshealthcheck/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/httpshealthcheck/v1beta1.py new file mode 100644 index 000000000..a8f569e32 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/httpshealthcheck/v1beta1.py @@ -0,0 +1,326 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_httpshealthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. If + left empty (default value), the public IP on behalf of which this + health check is performed will be used. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/httpsHealthChecks/{{name}} + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class HTTPSHealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['HTTPSHealthCheck']] = 'HTTPSHealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + HTTPSHealthCheckSpec defines the desired state of HTTPSHealthCheck + """ + status: Optional[Status] = None + """ + HTTPSHealthCheckStatus defines the observed state of HTTPSHealthCheck. + """ + + +class HTTPSHealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[HTTPSHealthCheck] + """ + List of httpshealthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/image/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/image/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/image/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/image/v1beta1.py new file mode 100644 index 000000000..bb17bd579 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/image/v1beta1.py @@ -0,0 +1,856 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_image.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2. + """ + + +class RawKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class ImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is stored in Google Cloud + KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class RawDisk(BaseModel): + containerType: Optional[str] = None + """ + The format used to encode and transmit the block device, which + should be TAR. This is just a container and transmission format + and not a runtime format. Provided by the client when the disk + image is created. + Default value is TAR. + Possible values are: TAR. + """ + sha1: Optional[str] = None + """ + An optional SHA1 checksum of the disk image before unpackaging. + This is provided by the client when the disk image is created. + """ + source: Optional[str] = None + """ + The full Google Cloud Storage URL where disk storage is stored + You must provide either this property or the sourceDisk property + but not both. + """ + + +class Db(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Dbx(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Kek(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class Pk(BaseModel): + content: Optional[str] = None + """ + The raw content in the secure keys file. + A base64-encoded string. + """ + fileType: Optional[str] = None + """ + The file type of source file. + """ + + +class ShieldedInstanceInitialState(BaseModel): + dbs: Optional[List[Db]] = None + """ + The Key Database (db). + Structure is documented below. + """ + dbxs: Optional[List[Dbx]] = None + """ + The forbidden key database (dbx). + Structure is documented below. + """ + keks: Optional[List[Kek]] = None + """ + The Key Exchange Key (KEK). + Structure is documented below. + """ + pk: Optional[Pk] = None + """ + The Platform Key (PK). + Structure is documented below. + """ + + +class SourceDiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceDiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceDiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + imageEncryptionKey: Optional[ImageEncryptionKey] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[RawDisk] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + shieldedInstanceInitialState: Optional[ShieldedInstanceInitialState] = None + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + imageEncryptionKey: Optional[ImageEncryptionKey] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[RawDisk] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + shieldedInstanceInitialState: Optional[ShieldedInstanceInitialState] = None + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is stored in Google Cloud + KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceDiskEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key used to decrypt this resource. Also called KmsKeyName + in the cloud console. Your project's Compute Engine System service account + (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have + roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. + See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the + given KMS key. If absent, the Compute Engine default service + account is used. + """ + + +class AtProvider(BaseModel): + archiveSizeBytes: Optional[float] = None + """ + Size of the image tar.gz archive stored in Google Cloud Storage (in + bytes). + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the image when restored onto a persistent disk (in GB). + """ + effectiveLabels: Optional[Dict[str, str]] = None + family: Optional[str] = None + """ + The name of the image family to which this image belongs. You can + create disks by specifying an image family instead of a specific + image name. The image family always returns its latest image that is + not deprecated. The name of the image family must comply with + RFC1035. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable images. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/images/{{name}} + """ + imageEncryptionKey: Optional[ImageEncryptionKeyModel] = None + """ + Encrypts the image using a customer-supplied encryption key. + After you encrypt an image with a customer-supplied key, you must + provide the same key if you use the image later (e.g. to create a + disk from the image) + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Image. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rawDisk: Optional[RawDisk] = None + """ + The parameters of the raw disk image. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shieldedInstanceInitialState: Optional[ShieldedInstanceInitialState] = None + """ + Set the secure boot keys of shielded instance. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + The source disk to create this image based on. + You must provide either this property or the + rawDisk.source property but not both to create an image. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source disk. Required if + the source disk is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceImage: Optional[str] = None + """ + URL of the source image used to create this image. In order to create an image, you must provide the full or partial + URL of one of the following: + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source image. Required if + the source image is protected by a customer-supplied encryption key. + Structure is documented below. + """ + sourceSnapshot: Optional[str] = None + """ + URL of the source snapshot used to create this image. + In order to create an image, you must provide the full or partial URL of one of the following: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required if + the source snapshot is protected by a customer-supplied encryption key. + Structure is documented below. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the image + (regional or multi-regional). + Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Image(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Image']] = 'Image' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ImageSpec defines the desired state of Image + """ + status: Optional[Status] = None + """ + ImageStatus defines the observed state of Image. + """ + + +class ImageList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Image] + """ + List of images. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/imageiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/imageiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/imageiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/imageiammember/v1beta1.py new file mode 100644 index 000000000..ad0ea246c --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/imageiammember/v1beta1.py @@ -0,0 +1,264 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_imageiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ImageRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ImageSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + image: Optional[str] = None + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + image: Optional[str] = None + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + image: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ImageIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ImageIAMMember']] = 'ImageIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ImageIAMMemberSpec defines the desired state of ImageIAMMember + """ + status: Optional[Status] = None + """ + ImageIAMMemberStatus defines the observed state of ImageIAMMember. + """ + + +class ImageIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ImageIAMMember] + """ + List of imageiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instance/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/instance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instance/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/instance/v1beta1.py new file mode 100644 index 000000000..3418818c6 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/instance/v1beta1.py @@ -0,0 +1,1908 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_instance.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + enableUefiNetworking: Optional[bool] = None + """ + Whether to enable UEFI networking for instance creation. + """ + performanceMonitoringUnit: Optional[str] = None + """ + The PMU is a hardware component within the CPU core that monitors how the processor runs code. Valid values for the level of PMU are STANDARD, ENHANCED, and ARCHITECTURAL. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + """ + turboMode: Optional[str] = None + """ + Turbo frequency mode to use for the instance. Supported modes are currently either ALL_CORE_MAX or unset (default). + """ + visibleCoreCount: Optional[float] = None + """ + The number of physical cores to expose to an instance. visible cores info (VC). + """ + + +class DiskEncryptionKeyRawSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class DiskEncryptionKeyRsaSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class AttachedDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + Name with which the attached disk will be accessible + under /dev/disk/by-id/google-* + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + Either "READ_ONLY" or "READ_WRITE", defaults to "READ_WRITE" + If you have a persistent disk with data that you want to share + between multiple instances, detach it from any read-write instances and + attach it to one or more instances in read-only mode. + """ + source: Optional[str] = None + """ + The name or self_link of the disk to attach to this instance. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ImageRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ImageSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RawKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class InitializeParams(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + imageRef: Optional[ImageRef] = None + """ + Reference to a Image in compute to populate image. + """ + imageSelector: Optional[ImageSelector] = None + """ + Selector for a Image in compute to populate image. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. + This sets the number of I/O operations per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of IOPS every 4 hours. To update your hyperdisk more frequently, + you'll need to manually delete and recreate it. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. + This sets the number of throughput mb per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of throughput every 4 hours. To update your hyperdisk more + frequently, you'll need to manually delete and recreate it. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + snapshot: Optional[str] = None + """ + The snapshot from which to initialize this disk. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + Encryption key used to decrypt the given image. Structure is documented below. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + Encryption key used to decrypt the given snapshot. Structure is documented below. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class BootDisk(BaseModel): + autoDelete: Optional[bool] = None + """ + Whether the disk will be auto-deleted when the instance + is deleted. Defaults to true. + """ + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + initializeParams: Optional[InitializeParams] = None + """ + Parameters for a new disk that will be created + alongside the new instance. Either initialize_params or source must be set. + Structure is documented below. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, + disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + """ + source: Optional[str] = None + """ + The name or self_link of the existing disk (such as those managed by + google_compute_disk) or disk image. To create an instance from a snapshot, first create a + google_compute_disk from a snapshot and reference it here. + """ + + +class ConfidentialInstanceConfig(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the confidential computing technology the instance uses. SEV is an AMD feature. TDX is an Intel feature. One of the following values is required: SEV, SEV_SNP, TDX. on_host_maintenance can be set to MIGRATE if confidential_instance_type is set to SEV and min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. If SEV_SNP, currently min_cpu_platform has to be set to "AMD Milan" or this will fail to create the VM. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Defines whether the instance should have confidential compute enabled with AMD SEV. If enabled, on_host_maintenance can be set to MIGRATE if min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class InstanceEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt the data on this instance. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + """ + If the instance has an access config, either the given external ip (in the nat_ip field) or the ephemeral (generated) ip (if you didn't provide one). + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM or STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The domain name to be used when creating DNSv6 + records for the external IPv6 ranges.. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The IP CIDR range represented by this alias IP range. This IP CIDR range + must belong to the specified subnetwork and cannot contain IP addresses reserved by + system or used by other network interfaces. This range may be a single IP address + (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24). + """ + subnetworkRangeName: Optional[str] = None + """ + The subnetwork secondary range name specifying + the secondary range from which to allocate the IP CIDR range for this alias IP + range. If left unspecified, the primary range of the subnetwork will be used. + """ + + +class Ipv6AccessConfigItem(BaseModel): + externalIpv6: Optional[str] = None + """ + The first IPv6 address of the external IPv6 range associated + with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. + To use a static external IP address, it must be unused and in the same region as the instance's zone. + If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork. + """ + externalIpv6PrefixLength: Optional[str] = None + """ + The prefix length of the external IPv6 range. + """ + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM or STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The domain name to be used when creating DNSv6 + records for the external IPv6 ranges.. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet. Omit to ensure that the instance + is not accessible from the Internet.g. via + tunnel or because it is running on another cloud instance on that network). + This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6Address: Optional[str] = None + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Either network or subnetwork must be provided. If network isn't provided it will + be inferred from the subnetwork. + """ + networkAttachment: Optional[str] = None + """ + The URL of the network attachment that this interface should connect to in the following format: projects/{projectNumber}/regions/{region_name}/networkAttachments/{network_attachment_name}. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, IDPF, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the subnetwork to attach this + interface to. Either network or subnetwork must be provided. If network isn't provided + it will be inferred from the subnetwork. The subnetwork must exist in the same region this + instance will be created in. If the network resource is in + legacy mode, do not specify this field. If the + network is in auto subnet mode, specifying the subnetwork is optional. If the network is + in custom subnet mode, specifying the subnetwork is required. + """ + subnetworkProject: Optional[str] = None + """ + The project in which the subnetwork belongs. + If the subnetwork is a self_link, this field is set to the project + defined in the subnetwork self_link. If the subnetwork is a name and this + field is not provided, the provider project is used. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + The egress bandwidth tier to enable. + Possible values: TIER_1, DEFAULT + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + + +class SpecificReservation(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class ReservationAffinity(BaseModel): + specificReservation: Optional[SpecificReservation] = None + """ + Specifies the label selector for the reservation to use.. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class LocalSsdRecoveryTimeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class MaxRunDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + operator: Optional[str] = None + """ + The operator. Can be IN for node-affinities + or NOT_IN for anti-affinities. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class OnInstanceStopAction(BaseModel): + discardLocalSsd: Optional[bool] = None + """ + Whether to discard local SSDs attached to the VM while terminating using max_run_duration. Only supports true at this point. + """ + + +class Scheduling(BaseModel): + automaticRestart: Optional[bool] = None + """ + Specifies if the instance should be + restarted if it was terminated by Compute Engine (not a user). + Defaults to true. + """ + availabilityDomain: Optional[float] = None + """ + Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + """ + instanceTerminationAction: Optional[str] = None + """ + Describe the type of termination action for VM. Can be STOP or DELETE. Read more on here + """ + localSsdRecoveryTimeout: Optional[LocalSsdRecoveryTimeout] = None + """ + io/docs/providers/google/guides/provider_versions.html) Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. Structure is documented below. + """ + maxRunDuration: Optional[MaxRunDuration] = None + """ + The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in instance_termination_action. Structure is documented below. + """ + minNodeCpus: Optional[float] = None + """ + The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + """ + nodeAffinities: Optional[List[NodeAffinity]] = None + """ + Specifies node affinities or anti-affinities + to determine which sole-tenant nodes your instances and managed instance + groups will use as host systems. Read more on sole-tenant node creation + here. + Structure documented below. + """ + onHostMaintenance: Optional[str] = None + """ + Describes maintenance behavior for the + instance. Can be MIGRATE or TERMINATE, for more info, read + here. + """ + onInstanceStopAction: Optional[OnInstanceStopAction] = None + """ + Specifies the action to be performed when the instance is terminated using max_run_duration and STOP instance_termination_action. Only support true discard_local_ssd at this point. Structure is documented below. + """ + preemptible: Optional[bool] = None + """ + Specifies if the instance is preemptible. + If this field is set to true, then automatic_restart must be + set to false. Defaults to false. + """ + provisioningModel: Optional[str] = None + """ + Describe the type of preemptible VM. This field accepts the value STANDARD or SPOT. If the value is STANDARD, there will be no discount. If this is set to SPOT, + preemptible should be true and automatic_restart should be + false. For more info about + SPOT, read here + """ + terminationTime: Optional[str] = None + """ + Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + """ + + +class ScratchDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + + +class EmailRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EmailSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceAccount(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + emailRef: Optional[EmailRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate email. + """ + emailSelector: Optional[EmailSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate email. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + - Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + enableSecureBoot: Optional[bool] = None + """ + - Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + enableVtpm: Optional[bool] = None + """ + - Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[BootDisk] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[Params] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + zone: str + """ + The zone that the machine should be created in. If it is not provided, the provider zone is used. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[BootDisk] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[Params] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AttachedDiskItemModel(BaseModel): + deviceName: Optional[str] = None + """ + Name with which the attached disk will be accessible + under /dev/disk/by-id/google-* + """ + diskEncryptionKeySha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + Either "READ_ONLY" or "READ_WRITE", defaults to "READ_WRITE" + If you have a persistent disk with data that you want to share + between multiple instances, detach it from any read-write instances and + attach it to one or more instances in read-only mode. + """ + source: Optional[str] = None + """ + The name or self_link of the disk to attach to this instance. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to decrypt the given image. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class InitializeParamsModel(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Whether this disk is using confidential compute mode. + Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true. + """ + image: Optional[str] = None + """ + The image from which to initialize this disk. This can be + one of: the image's self_link, projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. If referred by family, the + images names must include the family name. If they don't, use the + google_compute_image data source. + For instance, the image centos-6-v20180104 includes its family name centos-6. + These images can be referred by family name here. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. + This sets the number of I/O operations per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of IOPS every 4 hours. To update your hyperdisk more frequently, + you'll need to manually delete and recreate it. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. + This sets the number of throughput mb per second that the disk can handle. + For more details,see the Hyperdisk documentation. + Note: Updating currently is only supported for hyperdisk skus via disk update + api/gcloud without the need to delete and recreate the disk, hyperdisk allows + for an update of throughput every 4 hours. To update your hyperdisk more + frequently, you'll need to manually delete and recreate it. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + size: Optional[float] = None + """ + The size of the image in gigabytes. If not specified, it + will inherit the size of its base image. + """ + snapshot: Optional[str] = None + """ + The snapshot from which to initialize this disk. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + Encryption key used to decrypt the given image. Structure is documented below. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + Encryption key used to decrypt the given snapshot. Structure is documented below. + """ + storagePool: Optional[str] = None + """ + The URL or the name of the storage pool in which the new disk is created. + For example: + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class BootDiskModel(BaseModel): + autoDelete: Optional[bool] = None + """ + Whether the disk will be auto-deleted when the instance + is deleted. Defaults to true. + """ + deviceName: Optional[str] = None + """ + Name with which attached disk will be accessible. + On the instance, this device will be /dev/disk/by-id/google-{{device_name}}. + """ + diskEncryptionKeySha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + diskEncryptionServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + forceAttach: Optional[bool] = None + """ + boolean field that determines whether to force attach the regional + disk even if it's currently attached to another instance. If you try to force attach a zonal + disk to an instance, you will receive an error. Setting this parameter cause VM recreation. + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + initializeParams: Optional[InitializeParamsModel] = None + """ + Parameters for a new disk that will be created + alongside the new instance. Either initialize_params or source must be set. + Structure is documented below. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk; either SCSI or NVME. + """ + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link, + disk_encryption_key_rsa and disk_encryption_key_raw + may be set. + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + """ + source: Optional[str] = None + """ + The name or self_link of the existing disk (such as those managed by + google_compute_disk) or disk image. To create an instance from a snapshot, first create a + google_compute_disk from a snapshot and reference it here. + """ + + +class InstanceEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self_link of the encryption key that is + stored in Google Cloud KMS to encrypt the data on this instance. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + """ + sha256: Optional[str] = None + """ + The RFC 4648 base64 + encoded SHA-256 hash of the [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. + """ + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet. Omit to ensure that the instance + is not accessible from the Internet.g. via + tunnel or because it is running on another cloud instance on that network). + This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6AccessType: Optional[str] = None + """ + One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. + This field is always inherited from its subnetwork. + """ + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Either network or subnetwork must be provided. If network isn't provided it will + be inferred from the subnetwork. + """ + networkAttachment: Optional[str] = None + """ + The URL of the network attachment that this interface should connect to in the following format: projects/{projectNumber}/regions/{region_name}/networkAttachments/{network_attachment_name}. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, IDPF, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the subnetwork to attach this + interface to. Either network or subnetwork must be provided. If network isn't provided + it will be inferred from the subnetwork. The subnetwork must exist in the same region this + instance will be created in. If the network resource is in + legacy mode, do not specify this field. If the + network is in auto subnet mode, specifying the subnetwork is optional. If the network is + in custom subnet mode, specifying the subnetwork is required. + """ + subnetworkProject: Optional[str] = None + """ + The project in which the subnetwork belongs. + If the subnetwork is a self_link, this field is set to the project + defined in the subnetwork self_link. If the subnetwork is a name and this + field is not provided, the provider project is used. + """ + + +class ServiceAccountModel(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + allowStoppingForUpdate: Optional[bool] = None + """ + If you try to update a property that requires stopping the instance without setting this field, the update will fail. + """ + attachedDisk: Optional[List[AttachedDiskItemModel]] = None + """ + Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below. + """ + bootDisk: Optional[BootDiskModel] = None + """ + The boot disk for the instance. + Structure is documented below. + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. + This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + cpuPlatform: Optional[str] = None + """ + The CPU platform used by this instance. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + currentStatus: Optional[str] = None + """ + The current status of the instance. This could be one of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + """ + deletionProtection: Optional[bool] = None + """ + Enable deletion protection on this instance. Defaults to false. + Note: you must disable deletion protection before removing the resource (e.g. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + desiredStatus: Optional[str] = None + """ + Desired status of the instance. Either + "RUNNING", "SUSPENDED" or "TERMINATED". + """ + effectiveLabels: Optional[Dict[str, str]] = None + enableDisplay: Optional[bool] = None + """ + Enable Virtual Displays on this instance. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + hostname: Optional[str] = None + """ + A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. + Valid format is a series of labels 1-63 characters long matching the regular expression [a-z]([-a-z0-9]*[a-z0-9]), concatenated with periods. + The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instances/{{name}} + """ + instanceEncryptionKey: Optional[InstanceEncryptionKeyModel] = None + """ + Configuration for data encryption on the instance with encryption keys. Structure is documented below. + """ + instanceId: Optional[str] = None + """ + The server-assigned unique identifier of this instance. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labelFingerprint: Optional[str] = None + """ + The unique fingerprint of the labels. + """ + labels: Optional[Dict[str, str]] = None + """ + A map of key/value label pairs to assign to the instance. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within the instance. Ssh keys attached in the Cloud Console will be removed. + Add them to your config in order to keep them attached to your instance. + A list of predefined metadata keys (e.g. ssh-keys) can be found here + """ + metadataFingerprint: Optional[str] = None + """ + The unique fingerprint of the metadata. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, except this one forces the instance to be recreated + (thus re-running the script) if it is changed. This replaces the startup-script + metadata key on the created instance and thus the two mechanisms are not + allowed to be used simultaneously. Users are free to use either mechanism - the + only distinction is that this separate attribute will cause a recreate on + modification. On import, metadata_startup_script will not be set - if you + choose to specify it you will see a diff immediately after import causing a + destroy/recreate operation. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + """ + Networks to attach to the instance. This can + be specified multiple times. Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + params: Optional[Params] = None + """ + Additional instance parameters. + . + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + scratchDisk: Optional[List[ScratchDiskItem]] = None + """ + Scratch disks to attach to the instance. This can be + specified multiple times for multiple scratch disks. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serviceAccount: Optional[ServiceAccountModel] = None + """ + Service account to attach to the instance. + Structure is documented below. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field. + """ + tags: Optional[List[str]] = None + """ + A list of network tags to attach to the instance. + """ + tagsFingerprint: Optional[str] = None + """ + The unique fingerprint of the tags. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + zone: Optional[str] = None + """ + The zone that the machine should be created in. If it is not provided, the provider zone is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Instance(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Instance']] = 'Instance' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceSpec defines the desired state of Instance + """ + status: Optional[Status] = None + """ + InstanceStatus defines the observed state of Instance. + """ + + +class InstanceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Instance] + """ + List of instances. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancefromtemplate/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/instancefromtemplate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancefromtemplate/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/instancefromtemplate/v1beta1.py new file mode 100644 index 000000000..24c372e34 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/instancefromtemplate/v1beta1.py @@ -0,0 +1,853 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_instancefromtemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + enableUefiNetworking: Optional[bool] = None + performanceMonitoringUnit: Optional[str] = None + threadsPerCore: Optional[float] = None + turboMode: Optional[str] = None + visibleCoreCount: Optional[float] = None + + +class DiskEncryptionKeyRawSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class DiskEncryptionKeyRsaSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class AttachedDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class RawKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + + +class InitializeParams(BaseModel): + architecture: Optional[str] = None + enableConfidentialCompute: Optional[bool] = None + image: Optional[str] = None + labels: Optional[Dict[str, str]] = None + provisionedIops: Optional[float] = None + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + resourcePolicies: Optional[List[str]] = None + size: Optional[float] = None + snapshot: Optional[str] = None + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + storagePool: Optional[str] = None + type: Optional[str] = None + + +class BootDisk(BaseModel): + autoDelete: Optional[bool] = None + """ + Default is 6 minutes. + """ + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeyRawSecretRef: Optional[DiskEncryptionKeyRawSecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + diskEncryptionKeyRsaSecretRef: Optional[DiskEncryptionKeyRsaSecretRef] = None + """ + A LocalSecretKeySelector is a reference to a secret key + in the same namespace with the referencing object. + """ + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + guestOsFeatures: Optional[List[str]] = None + initializeParams: Optional[InitializeParams] = None + interface: Optional[str] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class ConfidentialInstanceConfig(BaseModel): + confidentialInstanceType: Optional[str] = None + enableConfidentialCompute: Optional[bool] = None + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + type: Optional[str] = None + + +class InstanceEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + networkTier: Optional[str] = None + publicPtrDomainName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + subnetworkRangeName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class Ipv6AccessConfigItem(BaseModel): + externalIpv6: Optional[str] = None + externalIpv6PrefixLength: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkTier: Optional[str] = None + publicPtrDomainName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + ipv6Address: Optional[str] = None + network: Optional[str] = None + networkAttachment: Optional[str] = None + networkIp: Optional[str] = None + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + queueCount: Optional[float] = None + stackType: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkProject: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + + +class SpecificReservation(BaseModel): + key: Optional[str] = None + values: Optional[List[str]] = None + + +class ReservationAffinity(BaseModel): + specificReservation: Optional[SpecificReservation] = None + type: Optional[str] = None + + +class LocalSsdRecoveryTimeout(BaseModel): + nanos: Optional[float] = None + seconds: Optional[float] = None + + +class MaxRunDuration(BaseModel): + nanos: Optional[float] = None + seconds: Optional[float] = None + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + operator: Optional[str] = None + values: Optional[List[str]] = None + + +class OnInstanceStopAction(BaseModel): + discardLocalSsd: Optional[bool] = None + + +class Scheduling(BaseModel): + automaticRestart: Optional[bool] = None + availabilityDomain: Optional[float] = None + instanceTerminationAction: Optional[str] = None + localSsdRecoveryTimeout: Optional[LocalSsdRecoveryTimeout] = None + maxRunDuration: Optional[MaxRunDuration] = None + minNodeCpus: Optional[float] = None + nodeAffinities: Optional[List[NodeAffinity]] = None + onHostMaintenance: Optional[str] = None + onInstanceStopAction: Optional[OnInstanceStopAction] = None + preemptible: Optional[bool] = None + provisioningModel: Optional[str] = None + terminationTime: Optional[str] = None + + +class ScratchDiskItem(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + interface: Optional[str] = None + size: Optional[float] = None + + +class ServiceAccount(BaseModel): + email: Optional[str] = None + scopes: Optional[List[str]] = None + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + enableSecureBoot: Optional[bool] = None + enableVtpm: Optional[bool] = None + + +class SourceInstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceInstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + bootDisk: Optional[BootDisk] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + keyRevocationActionType: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + params: Optional[Params] = None + project: Optional[str] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[Scheduling] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + serviceAccount: Optional[ServiceAccount] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + tags: Optional[List[str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItem]] = None + bootDisk: Optional[BootDisk] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + instanceEncryptionKey: Optional[InstanceEncryptionKey] = None + keyRevocationActionType: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + params: Optional[Params] = None + project: Optional[str] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[Scheduling] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + serviceAccount: Optional[ServiceAccount] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + tags: Optional[List[str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AttachedDiskItemModel(BaseModel): + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeySha256: Optional[str] = None + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class BootDiskModel(BaseModel): + autoDelete: Optional[bool] = None + """ + Default is 6 minutes. + """ + deviceName: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + diskEncryptionKeySha256: Optional[str] = None + diskEncryptionServiceAccount: Optional[str] = None + forceAttach: Optional[bool] = None + guestOsFeatures: Optional[List[str]] = None + initializeParams: Optional[InitializeParams] = None + interface: Optional[str] = None + kmsKeySelfLink: Optional[str] = None + mode: Optional[str] = None + source: Optional[str] = None + + +class InstanceEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + kmsKeyServiceAccount: Optional[str] = None + sha256: Optional[str] = None + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + ipv6AccessType: Optional[str] = None + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + network: Optional[str] = None + networkAttachment: Optional[str] = None + networkIp: Optional[str] = None + nicType: Optional[str] = None + queueCount: Optional[float] = None + stackType: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkProject: Optional[str] = None + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + allowStoppingForUpdate: Optional[bool] = None + """ + Default is 6 minutes. + """ + attachedDisk: Optional[List[AttachedDiskItemModel]] = None + bootDisk: Optional[BootDiskModel] = None + canIpForward: Optional[bool] = None + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + cpuPlatform: Optional[str] = None + creationTimestamp: Optional[str] = None + currentStatus: Optional[str] = None + deletionProtection: Optional[bool] = None + description: Optional[str] = None + desiredStatus: Optional[str] = None + effectiveLabels: Optional[Dict[str, str]] = None + enableDisplay: Optional[bool] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + hostname: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + id: Optional[str] = None + instanceEncryptionKey: Optional[InstanceEncryptionKeyModel] = None + instanceId: Optional[str] = None + keyRevocationActionType: Optional[str] = None + labelFingerprint: Optional[str] = None + labels: Optional[Dict[str, str]] = None + machineType: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + metadataFingerprint: Optional[str] = None + metadataStartupScript: Optional[str] = None + minCpuPlatform: Optional[str] = None + name: Optional[str] = None + """ + A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + params: Optional[Params] = None + project: Optional[str] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourcePolicies: Optional[List[str]] = None + scheduling: Optional[Scheduling] = None + scratchDisk: Optional[List[ScratchDiskItem]] = None + selfLink: Optional[str] = None + serviceAccount: Optional[ServiceAccount] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + sourceInstanceTemplate: Optional[str] = None + """ + Name or self link of an instance + template to create the instance based on. It is recommended to reference + instance templates through their unique id (self_link_unique attribute). + """ + tags: Optional[List[str]] = None + tagsFingerprint: Optional[str] = None + terraformLabels: Optional[Dict[str, str]] = None + zone: Optional[str] = None + """ + The zone that the machine should be created in. If not + set, the provider zone is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceFromTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceFromTemplate']] = 'InstanceFromTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceFromTemplateSpec defines the desired state of InstanceFromTemplate + """ + status: Optional[Status] = None + """ + InstanceFromTemplateStatus defines the observed state of InstanceFromTemplate. + """ + + +class InstanceFromTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceFromTemplate] + """ + List of instancefromtemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancegroup/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/instancegroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancegroup/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/instancegroup/v1beta1.py new file mode 100644 index 000000000..466b7ac9b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/instancegroup/v1beta1.py @@ -0,0 +1,404 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_instancegroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstancesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstancesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name which the port will be mapped to. + """ + port: Optional[float] = None + """ + The port number to map the name to. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional textual description of the instance + group. + """ + instances: Optional[List[str]] = None + """ + The list of instances in the group, in self_link format. + When adding instances they must all be in the same network and zone as the instance group. + """ + instancesRefs: Optional[List[InstancesRef]] = None + """ + References to Instance in compute to populate instances. + """ + instancesSelector: Optional[InstancesSelector] = None + """ + Selector for a list of Instance in compute to populate instances. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network the instance group is in. If + this is different from the network where the instances are in, the creation + fails. Defaults to the network where the instances are in (if neither + network nor instances is specified, this field will be blank). + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + zone: str + """ + The zone that this instance group should be created in. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional textual description of the instance + group. + """ + instances: Optional[List[str]] = None + """ + The list of instances in the group, in self_link format. + When adding instances they must all be in the same network and zone as the instance group. + """ + instancesRefs: Optional[List[InstancesRef]] = None + """ + References to Instance in compute to populate instances. + """ + instancesSelector: Optional[InstancesSelector] = None + """ + Selector for a list of Instance in compute to populate instances. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network the instance group is in. If + this is different from the network where the instances are in, the creation + fails. Defaults to the network where the instances are in (if neither + network nor instances is specified, this field will be blank). + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional textual description of the instance + group. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}/zones/{{zone}}/instanceGroups/{{name}} + """ + instances: Optional[List[str]] = None + """ + The list of instances in the group, in self_link format. + When adding instances they must all be in the same network and zone as the instance group. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network the instance group is in. If + this is different from the network where the instances are in, the creation + fails. Defaults to the network where the instances are in (if neither + network nor instances is specified, this field will be blank). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + The number of instances in the group. + """ + zone: Optional[str] = None + """ + The zone that this instance group should be created in. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceGroup']] = 'InstanceGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceGroupSpec defines the desired state of InstanceGroup + """ + status: Optional[Status] = None + """ + InstanceGroupStatus defines the observed state of InstanceGroup. + """ + + +class InstanceGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceGroup] + """ + List of instancegroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancegroupmanager/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/instancegroupmanager/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancegroupmanager/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/instancegroupmanager/v1beta1.py new file mode 100644 index 000000000..71c0027c4 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/instancegroupmanager/v1beta1.py @@ -0,0 +1,978 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_instancegroupmanager.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AllInstancesConfig(BaseModel): + labels: Optional[Dict[str, str]] = None + """ + , The label key-value pairs that you want to patch onto the instance. + """ + metadata: Optional[Dict[str, str]] = None + """ + , The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthCheckRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthCheckSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AutoHealingPolicies(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + healthCheckRef: Optional[HealthCheckRef] = None + """ + Reference to a HealthCheck in compute to populate healthCheck. + """ + healthCheckSelector: Optional[HealthCheckSelector] = None + """ + Selector for a HealthCheck in compute to populate healthCheck. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class InstanceLifecyclePolicy(BaseModel): + defaultActionOnFailure: Optional[str] = None + """ + , Specifies the action that a MIG performs on a failed VM. If the value of the on_failed_health_check field is DEFAULT_ACTION, then the same action also applies to the VMs on which your application fails a health check. Valid options are: DO_NOTHING, REPAIR. If DO_NOTHING, then MIG does not repair a failed VM. If REPAIR (default), then MIG automatically repairs a failed VM by recreating it. For more information, see about repairing VMs in a MIG. + """ + forceUpdateOnRepair: Optional[str] = None + """ + , Specifies whether to apply the group's latest configuration when repairing a VM. Valid options are: YES, NO. If YES and you updated the group's instance template or per-instance configurations after the VM was created, then these changes are applied when VM is repaired. If NO (default), then updates are applied in accordance with the group's update policy type. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name of the port. + """ + port: Optional[float] = None + """ + The port number. + """ + + +class WorkloadPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class WorkloadPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ResourcePolicies(BaseModel): + workloadPolicy: Optional[str] = None + """ + The URL of the workload policy that is specified for this managed instance group. It can be a full or partial URL. + """ + workloadPolicyRef: Optional[WorkloadPolicyRef] = None + """ + Reference to a ResourcePolicy in compute to populate workloadPolicy. + """ + workloadPolicySelector: Optional[WorkloadPolicySelector] = None + """ + Selector for a ResourcePolicy in compute to populate workloadPolicy. + """ + + +class StandbyPolicy(BaseModel): + initialDelaySec: Optional[float] = None + """ + - Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + """ + mode: Optional[str] = None + """ + - Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. Valid options are: MANUAL, SCALE_OUT_POOL. If MANUAL(default), you have full control over which VMs are stopped and suspended in the MIG. If SCALE_OUT_POOL, the MIG uses the VMs from the standby pools to accelerate the scale out by resuming or starting them and then automatically replenishes the standby pool with new VMs to maintain the target sizes. + """ + + +class StatefulDiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the disk when the VM is deleted, but do not delete the disk. ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently deleted from the instance group. The default is NEVER. + """ + deviceName: Optional[str] = None + """ + , The device name of the disk to be attached. + """ + + +class StatefulExternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the external ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the external ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the external Ip. Possible value: nic0 + """ + + +class StatefulInternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the internal ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the internal ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the internal Ip. Possible value: nic0 + """ + + +class TargetPoolsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetPoolsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UpdatePolicy(BaseModel): + maxSurgeFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. Conflicts with max_surge_percent. Both cannot be 0. + """ + maxSurgePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. Conflicts with max_surge_fixed. + """ + maxUnavailableFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. + """ + maxUnavailablePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.. + """ + minimalAction: Optional[str] = None + """ + - Minimal action to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + """ + replacementMethod: Optional[str] = None + """ + , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved. You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0. + """ + type: Optional[str] = None + """ + - The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + """ + + +class InstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetSize(BaseModel): + fixed: Optional[float] = None + """ + , The number of instances which are managed for this version. Conflicts with percent. + """ + percent: Optional[float] = None + """ + , The number of instances (calculated as percentage) which are managed for this version. Conflicts with fixed. + Note that when using percent, rounding will be in favor of explicitly set target_size values; a managed instance group with 2 instances and 2 versions, + one of which has a target_size.percent of 60 will create 2 instances of that version. + """ + + +class VersionItem(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. It is recommended to reference instance templates through their unique id (self_link_unique attribute). + """ + instanceTemplateRef: Optional[InstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate instanceTemplate. + """ + instanceTemplateSelector: Optional[InstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate instanceTemplate. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class ForProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[ResourcePolicies] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + zone: str + """ + The zone that instances in this group should be created + in. + """ + + +class InitProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[ResourcePolicies] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AutoHealingPoliciesModel(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class ResourcePoliciesModel(BaseModel): + workloadPolicy: Optional[str] = None + """ + The URL of the workload policy that is specified for this managed instance group. It can be a full or partial URL. + """ + + +class AllInstancesConfigItem(BaseModel): + currentRevision: Optional[str] = None + """ + Current all-instances configuration revision. This value is in RFC3339 text format. + """ + effective: Optional[bool] = None + """ + A bit indicating whether this configuration has been applied to all managed instances in the group. + """ + + +class PerInstanceConfig(BaseModel): + allEffective: Optional[bool] = None + """ + A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + """ + + +class StatefulItem(BaseModel): + hasStatefulConfig: Optional[bool] = None + """ + A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + """ + perInstanceConfigs: Optional[List[PerInstanceConfig]] = None + """ + Status of per-instance configs on the instances. + """ + + +class VersionTargetItem(BaseModel): + isReached: Optional[bool] = None + + +class StatusItem(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Status of all-instances configuration on the group. + """ + isStable: Optional[bool] = None + """ + A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + """ + stateful: Optional[List[StatefulItem]] = None + """ + Stateful status of the given Instance Group Manager. + """ + versionTarget: Optional[List[VersionTargetItem]] = None + """ + A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + """ + + +class VersionItemModel(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. It is recommended to reference instance templates through their unique id (self_link_unique attribute). + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class AtProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPoliciesModel] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + fingerprint: Optional[str] = None + """ + The fingerprint of the instance group manager. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}} + """ + instanceGroup: Optional[str] = None + """ + The full URL of the instance group created by the manager. + """ + instanceGroupManagerId: Optional[float] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{name}} + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + operation: Optional[str] = None + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + resourcePolicies: Optional[ResourcePoliciesModel] = None + """ + Resource policies for this managed instance group. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URL of the created resource. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + status: Optional[List[StatusItem]] = None + """ + The status of this managed instance group. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API. + """ + version: Optional[List[VersionItemModel]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + zone: Optional[str] = None + """ + The zone that instances in this group should be created + in. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceGroupManager(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceGroupManager']] = 'InstanceGroupManager' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceGroupManagerSpec defines the desired state of InstanceGroupManager + """ + status: Optional[Status] = None + """ + InstanceGroupManagerStatus defines the observed state of InstanceGroupManager. + """ + + +class InstanceGroupManagerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceGroupManager] + """ + List of instancegroupmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancegroupnamedport/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/instancegroupnamedport/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancegroupnamedport/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/instancegroupnamedport/v1beta1.py new file mode 100644 index 000000000..e33aa5082 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/instancegroupnamedport/v1beta1.py @@ -0,0 +1,243 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_instancegroupnamedport.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + group: Optional[str] = None + """ + The name of the instance group. + """ + name: Optional[str] = None + """ + The name for this named port. The name must be 1-63 characters + long, and comply with RFC1035. + """ + port: Optional[float] = None + """ + The port number, which can be a value between 1 and 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + The zone of the instance group. + """ + + +class InitProvider(BaseModel): + group: Optional[str] = None + """ + The name of the instance group. + """ + name: Optional[str] = None + """ + The name for this named port. The name must be 1-63 characters + long, and comply with RFC1035. + """ + port: Optional[float] = None + """ + The port number, which can be a value between 1 and 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + The zone of the instance group. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + group: Optional[str] = None + """ + The name of the instance group. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/instanceGroups/{{group}}/{{port}}/{{name}} + """ + name: Optional[str] = None + """ + The name for this named port. The name must be 1-63 characters + long, and comply with RFC1035. + """ + port: Optional[float] = None + """ + The port number, which can be a value between 1 and 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + The zone of the instance group. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceGroupNamedPort(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceGroupNamedPort']] = 'InstanceGroupNamedPort' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceGroupNamedPortSpec defines the desired state of InstanceGroupNamedPort + """ + status: Optional[Status] = None + """ + InstanceGroupNamedPortStatus defines the observed state of InstanceGroupNamedPort. + """ + + +class InstanceGroupNamedPortList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceGroupNamedPort] + """ + List of instancegroupnamedports. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instanceiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/instanceiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instanceiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/instanceiammember/v1beta1.py new file mode 100644 index 000000000..410ab19d3 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/instanceiammember/v1beta1.py @@ -0,0 +1,267 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_instanceiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceNameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceNameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + instanceName: Optional[str] = None + instanceNameRef: Optional[InstanceNameRef] = None + """ + Reference to a Instance in compute to populate instanceName. + """ + instanceNameSelector: Optional[InstanceNameSelector] = None + """ + Selector for a Instance in compute to populate instanceName. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + instanceName: Optional[str] = None + instanceNameRef: Optional[InstanceNameRef] = None + """ + Reference to a Instance in compute to populate instanceName. + """ + instanceNameSelector: Optional[InstanceNameSelector] = None + """ + Selector for a Instance in compute to populate instanceName. + """ + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + instanceName: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + zone: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceIAMMember']] = 'InstanceIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceIAMMemberSpec defines the desired state of InstanceIAMMember + """ + status: Optional[Status] = None + """ + InstanceIAMMemberStatus defines the observed state of InstanceIAMMember. + """ + + +class InstanceIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceIAMMember] + """ + List of instanceiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancetemplate/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/instancetemplate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/instancetemplate/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/instancetemplate/v1beta1.py new file mode 100644 index 000000000..9001aca13 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/instancetemplate/v1beta1.py @@ -0,0 +1,1608 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_instancetemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + enableUefiNetworking: Optional[bool] = None + """ + Whether to enable UEFI networking for instance creation. + """ + performanceMonitoringUnit: Optional[str] = None + """ + The PMU is a hardware component within the CPU core that monitors how the processor runs code. Valid values for the level of PMU are STANDARD, ENHANCED, and ARCHITECTURAL. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + """ + turboMode: Optional[str] = None + """ + Turbo frequency mode to use for the instance. Supported modes are currently either ALL_CORE_MAX or unset (default). + """ + visibleCoreCount: Optional[float] = None + """ + The number of physical cores to expose to an instance. visible cores info (VC). + """ + + +class ConfidentialInstanceConfig(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the confidential computing technology the instance uses. SEV is an AMD feature. TDX is an Intel feature. One of the following values is required: SEV, SEV_SNP, TDX. on_host_maintenance can be set to MIGRATE if confidential_instance_type is set to SEV and min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. If SEV_SNP, currently min_cpu_platform has to be set to "AMD Milan" or this will fail to create the VM. + """ + enableConfidentialCompute: Optional[bool] = None + """ + Defines whether the instance should have confidential compute enabled with AMD SEV. If enabled, on_host_maintenance can be set to MIGRATE if min_cpu_platform is set to "AMD Milan". Otherwise, on_host_maintenance has to be set to TERMINATE or this will fail to create the VM. + """ + + +class DiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ResourcePoliciesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ResourcePoliciesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RawKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class SourceImageEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + A 256-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), + encoded in RFC 4648 base64 + to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit [customer-supplied encryption key] + (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) to decrypt this snapshot. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + + +class DiskItem(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + autoDelete: Optional[bool] = None + """ + Whether or not the disk should be auto-deleted. + This defaults to true. + """ + boot: Optional[bool] = None + """ + Indicates that this is a boot disk. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the + /dev/ tree of a Linux operating system running within the instance. If not + specified, the server chooses a default device name to apply to this disk. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts or decrypts a disk using a customer-supplied encryption key. + """ + diskName: Optional[str] = None + """ + Name of the disk. When not provided, this defaults + to the name of the instance. + """ + diskSizeGb: Optional[float] = None + """ + The size of the image in gigabytes. If not + specified, it will inherit the size of its base image. For SCRATCH disks, + the size must be exactly 375GB. + """ + diskType: Optional[str] = None + """ + The GCE disk type. Such as "pd-ssd", "local-ssd", + "pd-balanced" or "pd-standard", "hyperdisk-balanced", "hyperdisk-throughput" or "hyperdisk-extreme". + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + interface: Optional[str] = None + """ + Specifies the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + and the request will fail if you attempt to attach a persistent disk in any other format + than SCSI. Local SSDs can use either NVME or SCSI. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of ket/value label pairs to assign to disk created from + this template + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If you are attaching or creating a boot disk, this must + read-write mode. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This + sets the number of I/O operations per second that the disk can handle. + Values must be between 10,000 and 120,000. For more details, see the + Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to this disk. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + """ + resourcePoliciesRefs: Optional[List[ResourcePoliciesRef]] = None + """ + References to ResourcePolicy in compute to populate resourcePolicies. + """ + resourcePoliciesSelector: Optional[ResourcePoliciesSelector] = None + """ + Selector for a list of ResourcePolicy in compute to populate resourcePolicies. + """ + source: Optional[str] = None + """ + The name (not self_link) + of the disk (such as those managed by google_compute_disk) to attach. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImage: Optional[str] = None + """ + The image from which to + initialize this disk. This can be one of: the image's self_link, + projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKey] = None + """ + The customer-supplied encryption + key of the source image. Required if the source image is protected by a + customer-supplied encryption key. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + sourceSnapshot: Optional[str] = None + """ + The source snapshot to create this disk. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption + key of the source snapshot. Structure + documented below. + """ + type: Optional[str] = None + """ + The type of GCE disk, can be either "SCRATCH" or + "PERSISTENT". + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class AccessConfigItem(BaseModel): + natIp: Optional[str] = None + """ + The IP address that will be 1:1 mapped to the instance's + network ip. If not given, one will be generated. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + + +class AliasIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The IP CIDR range represented by this alias IP range. This IP CIDR range + must belong to the specified subnetwork and cannot contain IP addresses reserved by + system or used by other network interfaces. At the time of writing only a + netmask (e.g. /24) may be supplied, with a CIDR format resulting in an API + error. + """ + subnetworkRangeName: Optional[str] = None + """ + The subnetwork secondary range name specifying + the secondary range from which to allocate the IP CIDR range for this alias IP + range. If left unspecified, the primary range of the subnetwork will be used. + """ + + +class Ipv6AccessConfigItem(BaseModel): + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkInterfaceItem(BaseModel): + accessConfig: Optional[List[AccessConfigItem]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet.g. via tunnel or because it is running on another cloud instance + on that network). This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItem]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6Address: Optional[str] = None + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Use network attribute for Legacy or Auto subnetted networks and + subnetwork for custom subnetted networks. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + the name of the subnetwork to attach this interface + to. The subnetwork must exist in the same region this instance will be + created in. Either network or subnetwork must be provided. + """ + subnetworkProject: Optional[str] = None + """ + The ID of the project in which the subnetwork belongs. + If it is not provided, the provider project is used. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + The egress bandwidth tier to enable. Possible values: TIER_1, DEFAULT + """ + + +class SpecificReservation(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class ReservationAffinity(BaseModel): + specificReservation: Optional[SpecificReservation] = None + """ + Specifies the label selector for the reservation to use.. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type of reservation from which this instance can consume resources. + """ + + +class LocalSsdRecoveryTimeoutItem(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class MaxRunDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented with a 0 + seconds field and a positive nanos field. Must be from 0 to + 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + The value must be between 1 and 3600, which is 3,600 seconds (one hour).` + """ + + +class NodeAffinity(BaseModel): + key: Optional[str] = None + """ + Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value. + """ + operator: Optional[str] = None + """ + The operator. Can be IN for node-affinities + or NOT_IN for anti-affinities. + """ + values: Optional[List[str]] = None + """ + Corresponds to the label values of a reservation resource. + """ + + +class OnInstanceStopAction(BaseModel): + discardLocalSsd: Optional[bool] = None + """ + Whether to discard local SSDs attached to the VM while terminating using max_run_duration. Only supports true at this point. + """ + + +class Scheduling(BaseModel): + automaticRestart: Optional[bool] = None + """ + Specifies whether the instance should be + automatically restarted if it is terminated by Compute Engine (not + terminated by a user). This defaults to true. + """ + availabilityDomain: Optional[float] = None + """ + Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + """ + instanceTerminationAction: Optional[str] = None + """ + Describe the type of termination action for SPOT VM. Can be STOP or DELETE. Read more on here + """ + localSsdRecoveryTimeout: Optional[List[LocalSsdRecoveryTimeoutItem]] = None + """ + io/docs/providers/google/guides/provider_versions.html) Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. Structure is documented below. + """ + maxRunDuration: Optional[MaxRunDuration] = None + """ + The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in instance_termination_action. Structure is documented below. + """ + minNodeCpus: Optional[float] = None + nodeAffinities: Optional[List[NodeAffinity]] = None + """ + Specifies node affinities or anti-affinities + to determine which sole-tenant nodes your instances and managed instance + groups will use as host systems. Read more on sole-tenant node creation + here. + Structure documented below. + """ + onHostMaintenance: Optional[str] = None + """ + Defines the maintenance behavior for this + instance. + """ + onInstanceStopAction: Optional[OnInstanceStopAction] = None + """ + Specifies the action to be performed when the instance is terminated using max_run_duration and STOP instance_termination_action. Only support true discard_local_ssd at this point. Structure is documented below. + """ + preemptible: Optional[bool] = None + """ + Allows instance to be preempted. This defaults to + false. Read more on this + here. + """ + provisioningModel: Optional[str] = None + """ + Describe the type of preemptible VM. This field accepts the value STANDARD or SPOT. If the value is STANDARD, there will be no discount. If this is set to SPOT, + preemptible should be true and automatic_restart should be + false. For more info about + SPOT, read here + """ + terminationTime: Optional[str] = None + """ + Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + """ + + +class EmailRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class EmailSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceAccount(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. If not given, the + default Google Compute Engine service account is used. + """ + emailRef: Optional[EmailRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate email. + """ + emailSelector: Optional[EmailSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate email. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + - Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. + """ + enableSecureBoot: Optional[bool] = None + """ + - Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. + """ + enableVtpm: Optional[bool] = None + """ + - Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. + """ + + +class ForProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItem]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + + +class InitProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItem]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItem]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + serviceAccount: Optional[ServiceAccount] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SourceImageEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The self link of the encryption key that is + stored in Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key + may be set. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account being used for the + encryption request for the given KMS key. If absent, the Compute Engine + default service account is used. + """ + + +class DiskItemModel(BaseModel): + architecture: Optional[str] = None + """ + The architecture of the attached disk. Valid values are ARM64 or x86_64. + """ + autoDelete: Optional[bool] = None + """ + Whether or not the disk should be auto-deleted. + This defaults to true. + """ + boot: Optional[bool] = None + """ + Indicates that this is a boot disk. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the + /dev/ tree of a Linux operating system running within the instance. If not + specified, the server chooses a default device name to apply to this disk. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts or decrypts a disk using a customer-supplied encryption key. + """ + diskName: Optional[str] = None + """ + Name of the disk. When not provided, this defaults + to the name of the instance. + """ + diskSizeGb: Optional[float] = None + """ + The size of the image in gigabytes. If not + specified, it will inherit the size of its base image. For SCRATCH disks, + the size must be exactly 375GB. + """ + diskType: Optional[str] = None + """ + The GCE disk type. Such as "pd-ssd", "local-ssd", + "pd-balanced" or "pd-standard", "hyperdisk-balanced", "hyperdisk-throughput" or "hyperdisk-extreme". + """ + guestOsFeatures: Optional[List[str]] = None + """ + A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + """ + interface: Optional[str] = None + """ + Specifies the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + and the request will fail if you attempt to attach a persistent disk in any other format + than SCSI. Local SSDs can use either NVME or SCSI. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of ket/value label pairs to assign to disk created from + this template + """ + mode: Optional[str] = None + """ + The mode in which to attach this disk, either READ_WRITE + or READ_ONLY. If you are attaching or creating a boot disk, this must + read-write mode. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This + sets the number of I/O operations per second that the disk can handle. + Values must be between 10,000 and 120,000. For more details, see the + Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to this disk. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + """ + source: Optional[str] = None + """ + The name (not self_link) + of the disk (such as those managed by google_compute_disk) to attach. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImage: Optional[str] = None + """ + The image from which to + initialize this disk. This can be one of: the image's self_link, + projects/{project}/global/images/{image}, + projects/{project}/global/images/family/{family}, global/images/{image}, + global/images/family/{family}, family/{family}, {project}/{family}, + {project}/{image}, {family}, or {image}. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceImageEncryptionKey: Optional[SourceImageEncryptionKeyModel] = None + """ + The customer-supplied encryption + key of the source image. Required if the source image is protected by a + customer-supplied encryption key. + """ + sourceSnapshot: Optional[str] = None + """ + The source snapshot to create this disk. + ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption + key of the source snapshot. Structure + documented below. + """ + type: Optional[str] = None + """ + The type of GCE disk, can be either "SCRATCH" or + "PERSISTENT". + """ + + +class AccessConfigItemModel(BaseModel): + natIp: Optional[str] = None + """ + The IP address that will be 1:1 mapped to the instance's + network ip. If not given, one will be generated. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The name of the instance template. + """ + + +class Ipv6AccessConfigItemModel(BaseModel): + externalIpv6: Optional[str] = None + externalIpv6PrefixLength: Optional[str] = None + name: Optional[str] = None + """ + The name of the instance template. + """ + networkTier: Optional[str] = None + """ + The service-level to be provided for IPv6 traffic when the + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. + """ + publicPtrDomainName: Optional[str] = None + """ + The name of the instance template. + """ + + +class NetworkInterfaceItemModel(BaseModel): + accessConfig: Optional[List[AccessConfigItemModel]] = None + """ + Access configurations, i.e. IPs via which this + instance can be accessed via the Internet.g. via tunnel or because it is running on another cloud instance + on that network). This block can be specified once per network_interface. Structure documented below. + """ + aliasIpRange: Optional[List[AliasIpRangeItem]] = None + """ + An + array of alias IP ranges for this network interface. Can only be specified for network + interfaces on subnet-mode networks. Structure documented below. + """ + internalIpv6PrefixLength: Optional[float] = None + ipv6AccessConfig: Optional[List[Ipv6AccessConfigItemModel]] = None + """ + An array of IPv6 access configurations for this interface. + Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig + specified, then this instance will have no external IPv6 Internet access. Structure documented below. + """ + ipv6AccessType: Optional[str] = None + ipv6Address: Optional[str] = None + name: Optional[str] = None + """ + The name of the instance template. + """ + network: Optional[str] = None + """ + The name or self_link of the network to attach this interface to. + Use network attribute for Legacy or Auto subnetted networks and + subnetwork for custom subnetted networks. + """ + networkIp: Optional[str] = None + """ + The private IP address to assign to the instance. If + empty, the address will be automatically assigned. + """ + nicType: Optional[str] = None + """ + The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET, MRDMA, IRDMA. + """ + queueCount: Optional[float] = None + """ + The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. + """ + stackType: Optional[str] = None + """ + The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6, IPV6_ONLY or IPV4_ONLY. If not specified, IPV4_ONLY will be used. + """ + subnetwork: Optional[str] = None + """ + the name of the subnetwork to attach this interface + to. The subnetwork must exist in the same region this instance will be + created in. Either network or subnetwork must be provided. + """ + subnetworkProject: Optional[str] = None + """ + The ID of the project in which the subnetwork belongs. + If it is not provided, the provider project is used. + """ + + +class ServiceAccountModel(BaseModel): + email: Optional[str] = None + """ + The service account e-mail address. If not given, the + default Google Compute Engine service account is used. + """ + scopes: Optional[List[str]] = None + """ + A list of service scopes. Both OAuth2 URLs and gcloud + short names are supported. To allow full access to all Cloud APIs, use the + cloud-platform scope. See a complete list of scopes here. + """ + + +class AtProvider(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below + """ + canIpForward: Optional[bool] = None + """ + Whether to allow sending and receiving of + packets with non-matching source or destination IPs. This defaults to false. + """ + confidentialInstanceConfig: Optional[ConfidentialInstanceConfig] = None + """ + Enable Confidential Mode on this VM. Structure is documented below + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + A brief description of this resource. + """ + disk: Optional[List[DiskItemModel]] = None + """ + Disks to attach to instances created from this template. + This can be specified multiple times for multiple disks. Structure is + documented below. + """ + effectiveLabels: Optional[Dict[str, str]] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. Structure documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/instanceTemplates/{{name}} + """ + instanceDescription: Optional[str] = None + """ + A brief description to use for instances + created from this template. + """ + keyRevocationActionType: Optional[str] = None + """ + Action to be taken when a customer's encryption key is revoked. Supports STOP and NONE, with NONE being the default. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key/value label pairs to assign to instances + created from this template. + """ + machineType: Optional[str] = None + """ + The machine type to create. + """ + metadata: Optional[Dict[str, str]] = None + """ + Metadata key/value pairs to make available from + within instances created from this template. + """ + metadataFingerprint: Optional[str] = None + """ + The unique fingerprint of the metadata. + """ + metadataStartupScript: Optional[str] = None + """ + An alternative to using the + startup-script metadata key, mostly to match the compute_instance resource. + This replaces the startup-script metadata key on the created instance and + thus the two mechanisms are not allowed to be used simultaneously. + """ + minCpuPlatform: Optional[str] = None + """ + Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as + Intel Haswell or Intel Skylake. See the complete list here. + """ + name: Optional[str] = None + """ + The name of the instance template. + """ + namePrefix: Optional[str] = None + """ + Creates a unique name beginning with the specified + prefix. Conflicts with name. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + """ + networkInterface: Optional[List[NetworkInterfaceItemModel]] = None + """ + Networks to attach to instances created from + this template. This can be specified multiple times for multiple networks. + Structure is documented below. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + os-features, and network_interface.0.nic-type must be GVNIC + in order for this setting to take effect. + """ + numericId: Optional[str] = None + """ + numeric identifier of the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + An instance template is a global resource that is not + bound to a zone or a region. However, you can still specify some regional + resources in an instance template, which restricts the template to the + region where that resource resides. For example, a custom subnetwork + resource is tied to a specific region. Defaults to the region of the + Provider if no value is given. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + Specifies the reservations that this instance can consume from. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. + """ + resourcePolicies: Optional[List[str]] = None + """ + - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. + """ + scheduling: Optional[Scheduling] = None + """ + The scheduling strategy to use. More details about + this configuration option are detailed below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + selfLinkUnique: Optional[str] = None + """ + A special URI of the created resource that uniquely identifies this instance template with the following format: projects/{{project}}/global/instanceTemplates/{{name}}?uniqueId={{uniqueId}} + Referencing an instance template via this attribute prevents Time of Check to Time of Use attacks when the instance template resides in a shared/untrusted environment. + """ + serviceAccount: Optional[ServiceAccountModel] = None + """ + Service account to attach to the instance. Structure is documented below. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Enable Shielded VM on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. + Note: shielded_instance_config can only be used with boot images with shielded vm support. See the complete list here. + """ + tags: Optional[List[str]] = None + """ + Tags to attach to the instance. + """ + tagsFingerprint: Optional[str] = None + """ + The unique fingerprint of the tags. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InstanceTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['InstanceTemplate']] = 'InstanceTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InstanceTemplateSpec defines the desired state of InstanceTemplate + """ + status: Optional[Status] = None + """ + InstanceTemplateStatus defines the observed state of InstanceTemplate. + """ + + +class InstanceTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InstanceTemplate] + """ + List of instancetemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/interconnectattachment/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/interconnectattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/interconnectattachment/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/interconnectattachment/v1beta1.py new file mode 100644 index 000000000..3e66b13ed --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/interconnectattachment/v1beta1.py @@ -0,0 +1,740 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_interconnectattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class IpsecInternalAddressesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IpsecInternalAddressesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + adminEnabled: Optional[bool] = None + """ + Whether the VLAN attachment is enabled or disabled. When using + PARTNER type this will Pre-Activate the interconnect attachment + """ + bandwidth: Optional[str] = None + """ + Provisioned bandwidth capacity for the interconnect attachment. + For attachments of type DEDICATED, the user can set the bandwidth. + For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. + Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, + Defaults to BPS_10G + Possible values are: BPS_50M, BPS_100M, BPS_200M, BPS_300M, BPS_400M, BPS_500M, BPS_1G, BPS_2G, BPS_5G, BPS_10G, BPS_20G, BPS_50G, BPS_100G. + """ + candidateSubnets: Optional[List[str]] = None + """ + Up to 16 candidate prefixes that can be used to restrict the allocation + of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + All prefixes must be within link-local address space (169.254.0.0/16) + and must be /29 or shorter (/28, /27, etc). Google will attempt to select + an unused /29 from the supplied candidate prefix(es). The request will + fail if all possible /29s are in use on Google's edge. If not supplied, + Google will randomly select an unused /29 from all of link-local space. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeAvailabilityDomain: Optional[str] = None + """ + Desired availability domain for the attachment. Only available for type + PARTNER, at creation time. For improved reliability, customers should + configure a pair of attachments with one per availability domain. The + selected availability domain will be provided to the Partner via the + pairing key so that the provisioned circuit will lie in the specified + domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + """ + encryption: Optional[str] = None + """ + Indicates the user-supplied encryption option of this interconnect + attachment. Can only be specified at attachment creation for PARTNER or + DEDICATED attachments. + """ + interconnect: Optional[str] = None + """ + URL of the underlying Interconnect object that this attachment's + traffic will traverse through. Required if type is DEDICATED, must not + be set if type is PARTNER. + """ + ipsecInternalAddresses: Optional[List[str]] = None + """ + URL of addresses that have been reserved for the interconnect attachment, + Used only for interconnect attachment that has the encryption option as + IPSEC. + The addresses must be RFC 1918 IP address ranges. When creating HA VPN + gateway over the interconnect attachment, if the attachment is configured + to use an RFC 1918 IP address, then the VPN gateway's IP address will be + allocated from the IP address range specified here. + For example, if the HA VPN gateway's interface 0 is paired to this + interconnect attachment, then an RFC 1918 IP address for the VPN gateway + interface 0 will be allocated from the IP address specified for this + interconnect attachment. + If this field is not specified for interconnect attachment that has + encryption option as IPSEC, later on when creating HA VPN gateway on this + interconnect attachment, the HA VPN gateway's IP address will be + allocated from regional external IP address pool. + """ + ipsecInternalAddressesRefs: Optional[List[IpsecInternalAddressesRef]] = None + """ + References to Address in compute to populate ipsecInternalAddresses. + """ + ipsecInternalAddressesSelector: Optional[IpsecInternalAddressesSelector] = None + """ + Selector for a list of Address in compute to populate ipsecInternalAddresses. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels + method. Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + mtu: Optional[str] = None + """ + Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. + Valid values are 1440, 1460, 1500, and 8896. If not specified, the value will default to 1440. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the regional interconnect attachment resides. + """ + router: Optional[str] = None + """ + URL of the cloud router to be used for dynamic routing. This router must be in + the same region as this InterconnectAttachment. The InterconnectAttachment will + automatically connect the Interconnect to the network & region within which the + Cloud Router is configured. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + stackType: Optional[str] = None + """ + The stack type for this interconnect attachment to identify whether the IPv6 + feature is enabled or not. If not specified, IPV4_ONLY will be used. + This field can be both set at interconnect attachments creation and update + interconnect attachment operations. + Possible values are: IPV4_IPV6, IPV4_ONLY. + """ + subnetLength: Optional[float] = None + """ + Length of the IPv4 subnet mask. Allowed values: 29 (default), 30. The default value is 29, + except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a + constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure + remote location fall into this category. In these cases, the default value is 30, and + requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it + gives Google Cloud Support more debugging visibility. + """ + type: Optional[str] = None + """ + The type of InterconnectAttachment you wish to create. Defaults to + DEDICATED. + Possible values are: DEDICATED, PARTNER, PARTNER_PROVIDER. + """ + vlanTag8021Q: Optional[float] = None + """ + The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When + using PARTNER type this will be managed upstream. + """ + + +class InitProvider(BaseModel): + adminEnabled: Optional[bool] = None + """ + Whether the VLAN attachment is enabled or disabled. When using + PARTNER type this will Pre-Activate the interconnect attachment + """ + bandwidth: Optional[str] = None + """ + Provisioned bandwidth capacity for the interconnect attachment. + For attachments of type DEDICATED, the user can set the bandwidth. + For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. + Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, + Defaults to BPS_10G + Possible values are: BPS_50M, BPS_100M, BPS_200M, BPS_300M, BPS_400M, BPS_500M, BPS_1G, BPS_2G, BPS_5G, BPS_10G, BPS_20G, BPS_50G, BPS_100G. + """ + candidateSubnets: Optional[List[str]] = None + """ + Up to 16 candidate prefixes that can be used to restrict the allocation + of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + All prefixes must be within link-local address space (169.254.0.0/16) + and must be /29 or shorter (/28, /27, etc). Google will attempt to select + an unused /29 from the supplied candidate prefix(es). The request will + fail if all possible /29s are in use on Google's edge. If not supplied, + Google will randomly select an unused /29 from all of link-local space. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeAvailabilityDomain: Optional[str] = None + """ + Desired availability domain for the attachment. Only available for type + PARTNER, at creation time. For improved reliability, customers should + configure a pair of attachments with one per availability domain. The + selected availability domain will be provided to the Partner via the + pairing key so that the provisioned circuit will lie in the specified + domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + """ + encryption: Optional[str] = None + """ + Indicates the user-supplied encryption option of this interconnect + attachment. Can only be specified at attachment creation for PARTNER or + DEDICATED attachments. + """ + interconnect: Optional[str] = None + """ + URL of the underlying Interconnect object that this attachment's + traffic will traverse through. Required if type is DEDICATED, must not + be set if type is PARTNER. + """ + ipsecInternalAddresses: Optional[List[str]] = None + """ + URL of addresses that have been reserved for the interconnect attachment, + Used only for interconnect attachment that has the encryption option as + IPSEC. + The addresses must be RFC 1918 IP address ranges. When creating HA VPN + gateway over the interconnect attachment, if the attachment is configured + to use an RFC 1918 IP address, then the VPN gateway's IP address will be + allocated from the IP address range specified here. + For example, if the HA VPN gateway's interface 0 is paired to this + interconnect attachment, then an RFC 1918 IP address for the VPN gateway + interface 0 will be allocated from the IP address specified for this + interconnect attachment. + If this field is not specified for interconnect attachment that has + encryption option as IPSEC, later on when creating HA VPN gateway on this + interconnect attachment, the HA VPN gateway's IP address will be + allocated from regional external IP address pool. + """ + ipsecInternalAddressesRefs: Optional[List[IpsecInternalAddressesRef]] = None + """ + References to Address in compute to populate ipsecInternalAddresses. + """ + ipsecInternalAddressesSelector: Optional[IpsecInternalAddressesSelector] = None + """ + Selector for a list of Address in compute to populate ipsecInternalAddresses. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels + method. Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + mtu: Optional[str] = None + """ + Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. + Valid values are 1440, 1460, 1500, and 8896. If not specified, the value will default to 1440. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + router: Optional[str] = None + """ + URL of the cloud router to be used for dynamic routing. This router must be in + the same region as this InterconnectAttachment. The InterconnectAttachment will + automatically connect the Interconnect to the network & region within which the + Cloud Router is configured. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + stackType: Optional[str] = None + """ + The stack type for this interconnect attachment to identify whether the IPv6 + feature is enabled or not. If not specified, IPV4_ONLY will be used. + This field can be both set at interconnect attachments creation and update + interconnect attachment operations. + Possible values are: IPV4_IPV6, IPV4_ONLY. + """ + subnetLength: Optional[float] = None + """ + Length of the IPv4 subnet mask. Allowed values: 29 (default), 30. The default value is 29, + except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a + constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure + remote location fall into this category. In these cases, the default value is 30, and + requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it + gives Google Cloud Support more debugging visibility. + """ + type: Optional[str] = None + """ + The type of InterconnectAttachment you wish to create. Defaults to + DEDICATED. + Possible values are: DEDICATED, PARTNER, PARTNER_PROVIDER. + """ + vlanTag8021Q: Optional[float] = None + """ + The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When + using PARTNER type this will be managed upstream. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class PrivateInterconnectInfoItem(BaseModel): + tag8021q: Optional[float] = None + """ + (Output) + 802.1q encapsulation tag to be used for traffic between + Google and the customer, going to and from this network and region. + """ + + +class AtProvider(BaseModel): + adminEnabled: Optional[bool] = None + """ + Whether the VLAN attachment is enabled or disabled. When using + PARTNER type this will Pre-Activate the interconnect attachment + """ + attachmentGroup: Optional[str] = None + """ + URL of the AttachmentGroup that includes this Attachment. + """ + bandwidth: Optional[str] = None + """ + Provisioned bandwidth capacity for the interconnect attachment. + For attachments of type DEDICATED, the user can set the bandwidth. + For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. + Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, + Defaults to BPS_10G + Possible values are: BPS_50M, BPS_100M, BPS_200M, BPS_300M, BPS_400M, BPS_500M, BPS_1G, BPS_2G, BPS_5G, BPS_10G, BPS_20G, BPS_50G, BPS_100G. + """ + candidateSubnets: Optional[List[str]] = None + """ + Up to 16 candidate prefixes that can be used to restrict the allocation + of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + All prefixes must be within link-local address space (169.254.0.0/16) + and must be /29 or shorter (/28, /27, etc). Google will attempt to select + an unused /29 from the supplied candidate prefix(es). The request will + fail if all possible /29s are in use on Google's edge. If not supplied, + Google will randomly select an unused /29 from all of link-local space. + """ + cloudRouterIpAddress: Optional[str] = None + """ + IPv4 address + prefix length to be configured on Cloud Router + Interface for this interconnect attachment. + """ + cloudRouterIpv6Address: Optional[str] = None + """ + IPv6 address + prefix length to be configured on Cloud Router + Interface for this interconnect attachment. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customerRouterIpAddress: Optional[str] = None + """ + IPv4 address + prefix length to be configured on the customer + router subinterface for this interconnect attachment. + """ + customerRouterIpv6Address: Optional[str] = None + """ + IPv6 address + prefix length to be configured on the customer + router subinterface for this interconnect attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + edgeAvailabilityDomain: Optional[str] = None + """ + Desired availability domain for the attachment. Only available for type + PARTNER, at creation time. For improved reliability, customers should + configure a pair of attachments with one per availability domain. The + selected availability domain will be provided to the Partner via the + pairing key so that the provisioned circuit will lie in the specified + domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + encryption: Optional[str] = None + """ + Indicates the user-supplied encryption option of this interconnect + attachment. Can only be specified at attachment creation for PARTNER or + DEDICATED attachments. + """ + googleReferenceId: Optional[str] = None + """ + Google reference ID, to be used when raising support tickets with + Google or otherwise to debug backend connectivity issues. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}} + """ + interconnect: Optional[str] = None + """ + URL of the underlying Interconnect object that this attachment's + traffic will traverse through. Required if type is DEDICATED, must not + be set if type is PARTNER. + """ + ipsecInternalAddresses: Optional[List[str]] = None + """ + URL of addresses that have been reserved for the interconnect attachment, + Used only for interconnect attachment that has the encryption option as + IPSEC. + The addresses must be RFC 1918 IP address ranges. When creating HA VPN + gateway over the interconnect attachment, if the attachment is configured + to use an RFC 1918 IP address, then the VPN gateway's IP address will be + allocated from the IP address range specified here. + For example, if the HA VPN gateway's interface 0 is paired to this + interconnect attachment, then an RFC 1918 IP address for the VPN gateway + interface 0 will be allocated from the IP address specified for this + interconnect attachment. + If this field is not specified for interconnect attachment that has + encryption option as IPSEC, later on when creating HA VPN gateway on this + interconnect attachment, the HA VPN gateway's IP address will be + allocated from regional external IP address pool. + """ + labelFingerprint: Optional[str] = None + """ + A fingerprint for the labels being applied to this Interconnect, which is essentially a hash + of the labels set used for optimistic locking. The fingerprint is initially generated by + Compute Engine and changes after every request to modify or update labels. + You must always provide an up-to-date fingerprint hash in order to update or change labels, + otherwise the request will fail with error 412 conditionNotMet. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels for this resource. These can only be added or modified by the setLabels + method. Each label key/value pair must comply with RFC1035. Label values may be empty. + """ + mtu: Optional[str] = None + """ + Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. + Valid values are 1440, 1460, 1500, and 8896. If not specified, the value will default to 1440. + """ + pairingKey: Optional[str] = None + """ + [Output only for type PARTNER. Not present for DEDICATED]. The opaque + identifier of an PARTNER attachment used to initiate provisioning with + a selected partner. Of the form "XXXXX/region/domain" + """ + partnerAsn: Optional[str] = None + """ + [Output only for type PARTNER. Not present for DEDICATED]. Optional + BGP ASN for the router that should be supplied by a layer 3 Partner if + they configured BGP on behalf of the customer. + """ + privateInterconnectInfo: Optional[List[PrivateInterconnectInfoItem]] = None + """ + Information specific to an InterconnectAttachment. This property + is populated if the interconnect that this is attached to is of type DEDICATED. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the regional interconnect attachment resides. + """ + router: Optional[str] = None + """ + URL of the cloud router to be used for dynamic routing. This router must be in + the same region as this InterconnectAttachment. The InterconnectAttachment will + automatically connect the Interconnect to the network & region within which the + Cloud Router is configured. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + stackType: Optional[str] = None + """ + The stack type for this interconnect attachment to identify whether the IPv6 + feature is enabled or not. If not specified, IPV4_ONLY will be used. + This field can be both set at interconnect attachments creation and update + interconnect attachment operations. + Possible values are: IPV4_IPV6, IPV4_ONLY. + """ + state: Optional[str] = None + """ + [Output Only] The current state of this attachment's functionality. + """ + subnetLength: Optional[float] = None + """ + Length of the IPv4 subnet mask. Allowed values: 29 (default), 30. The default value is 29, + except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a + constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure + remote location fall into this category. In these cases, the default value is 30, and + requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it + gives Google Cloud Support more debugging visibility. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + The type of InterconnectAttachment you wish to create. Defaults to + DEDICATED. + Possible values are: DEDICATED, PARTNER, PARTNER_PROVIDER. + """ + vlanTag8021Q: Optional[float] = None + """ + The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When + using PARTNER type this will be managed upstream. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class InterconnectAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['InterconnectAttachment']] = 'InterconnectAttachment' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + InterconnectAttachmentSpec defines the desired state of InterconnectAttachment + """ + status: Optional[Status] = None + """ + InterconnectAttachmentStatus defines the observed state of InterconnectAttachment. + """ + + +class InterconnectAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[InterconnectAttachment] + """ + List of interconnectattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/managedsslcertificate/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/managedsslcertificate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/managedsslcertificate/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/managedsslcertificate/v1beta1.py new file mode 100644 index 000000000..8b56b072c --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/managedsslcertificate/v1beta1.py @@ -0,0 +1,271 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_managedsslcertificate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Managed(BaseModel): + domains: Optional[List[str]] = None + """ + Domains for which a managed SSL certificate will be valid. Currently, + there can be up to 100 domains in this list. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + managed: Optional[Managed] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + managed: Optional[Managed] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateId: Optional[float] = None + """ + The unique identifier for the resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + expireTime: Optional[str] = None + """ + Expire time of the certificate in RFC3339 text format. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/sslCertificates/{{name}} + """ + managed: Optional[Managed] = None + """ + Properties relevant to a managed certificate. These will be used if the + certificate is managed (as indicated by a value of MANAGED in type). + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subjectAlternativeNames: Optional[List[str]] = None + """ + Domains associated with the certificate via Subject Alternative Name. + """ + type: Optional[str] = None + """ + Enum field whose value is always MANAGED - used to signal to the API + which type this is. + Default value is MANAGED. + Possible values are: MANAGED. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ManagedSSLCertificate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ManagedSSLCertificate']] = 'ManagedSSLCertificate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ManagedSSLCertificateSpec defines the desired state of ManagedSSLCertificate + """ + status: Optional[Status] = None + """ + ManagedSSLCertificateStatus defines the observed state of ManagedSSLCertificate. + """ + + +class ManagedSSLCertificateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ManagedSSLCertificate] + """ + List of managedsslcertificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/network/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/network/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/network/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/network/v1beta1.py new file mode 100644 index 000000000..12246c5bd --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/network/v1beta1.py @@ -0,0 +1,459 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_network.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the network. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. + """ + + +class ForProvider(BaseModel): + autoCreateSubnetworks: Optional[bool] = None + """ + When set to true, the network is created in "auto subnet mode" and + it will create a subnet for each region automatically across the + 10.128.0.0/9 address range. + When set to false, the network is created in "custom subnet mode" so + the user can explicitly connect subnetwork resources. + """ + bgpAlwaysCompareMed: Optional[bool] = None + """ + Enables/disables the comparison of MED across routes with different Neighbor ASNs. + This value can only be set if the --bgp-best-path-selection-mode is STANDARD + """ + bgpBestPathSelectionMode: Optional[str] = None + """ + The BGP best selection algorithm to be employed. MODE can be LEGACY or STANDARD. + Possible values are: LEGACY, STANDARD. + """ + bgpInterRegionCost: Optional[str] = None + """ + Choice of the behavior of inter-regional cost and MED in the BPS algorithm. + Possible values are: DEFAULT, ADD_COST_TO_MED. + """ + deleteDefaultRoutesOnCreate: Optional[bool] = None + """ + If set to true, default routes (0.0.0.0/0) will be deleted + immediately after network creation. Defaults to false. + """ + description: Optional[str] = None + """ + An optional description of this resource. The resource must be + recreated to modify this field. + """ + enableUlaInternalIpv6: Optional[bool] = None + """ + Enable ULA internal ipv6 on this network. Enabling this feature will assign + a /48 from google defined ULA prefix fd20::/20. + """ + internalIpv6Range: Optional[str] = None + """ + When enabling ula internal ipv6, caller optionally can specify the /48 range + they want from the google defined ULA prefix fd20::/20. The input must be a + valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will + fail if the speficied /48 is already in used by another resource. + If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. + """ + mtu: Optional[float] = None + """ + Maximum Transmission Unit in bytes. The default value is 1460 bytes. + The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). + Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped + with an ICMP Fragmentation-Needed message if the packets are routed to the Internet or other VPCs + with varying MTUs. + """ + networkFirewallPolicyEnforcementOrder: Optional[str] = None + """ + Set the order that Firewall Rules and Firewall Policies are evaluated. + Default value is AFTER_CLASSIC_FIREWALL. + Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL. + """ + networkProfile: Optional[str] = None + """ + A full or partial URL of the network profile to apply to this network. + This field can be set only at resource creation time. For example, the + following are valid URLs: + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routingMode: Optional[str] = None + """ + The network-wide routing mode to use. If set to REGIONAL, this + network's cloud routers will only advertise routes with subnetworks + of this network in the same region as the router. If set to GLOBAL, + this network's cloud routers will advertise routes with all + subnetworks of this network, across regions. + Possible values are: REGIONAL, GLOBAL. + """ + + +class InitProvider(BaseModel): + autoCreateSubnetworks: Optional[bool] = None + """ + When set to true, the network is created in "auto subnet mode" and + it will create a subnet for each region automatically across the + 10.128.0.0/9 address range. + When set to false, the network is created in "custom subnet mode" so + the user can explicitly connect subnetwork resources. + """ + bgpAlwaysCompareMed: Optional[bool] = None + """ + Enables/disables the comparison of MED across routes with different Neighbor ASNs. + This value can only be set if the --bgp-best-path-selection-mode is STANDARD + """ + bgpBestPathSelectionMode: Optional[str] = None + """ + The BGP best selection algorithm to be employed. MODE can be LEGACY or STANDARD. + Possible values are: LEGACY, STANDARD. + """ + bgpInterRegionCost: Optional[str] = None + """ + Choice of the behavior of inter-regional cost and MED in the BPS algorithm. + Possible values are: DEFAULT, ADD_COST_TO_MED. + """ + deleteDefaultRoutesOnCreate: Optional[bool] = None + """ + If set to true, default routes (0.0.0.0/0) will be deleted + immediately after network creation. Defaults to false. + """ + description: Optional[str] = None + """ + An optional description of this resource. The resource must be + recreated to modify this field. + """ + enableUlaInternalIpv6: Optional[bool] = None + """ + Enable ULA internal ipv6 on this network. Enabling this feature will assign + a /48 from google defined ULA prefix fd20::/20. + """ + internalIpv6Range: Optional[str] = None + """ + When enabling ula internal ipv6, caller optionally can specify the /48 range + they want from the google defined ULA prefix fd20::/20. The input must be a + valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will + fail if the speficied /48 is already in used by another resource. + If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. + """ + mtu: Optional[float] = None + """ + Maximum Transmission Unit in bytes. The default value is 1460 bytes. + The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). + Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped + with an ICMP Fragmentation-Needed message if the packets are routed to the Internet or other VPCs + with varying MTUs. + """ + networkFirewallPolicyEnforcementOrder: Optional[str] = None + """ + Set the order that Firewall Rules and Firewall Policies are evaluated. + Default value is AFTER_CLASSIC_FIREWALL. + Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL. + """ + networkProfile: Optional[str] = None + """ + A full or partial URL of the network profile to apply to this network. + This field can be set only at resource creation time. For example, the + following are valid URLs: + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routingMode: Optional[str] = None + """ + The network-wide routing mode to use. If set to REGIONAL, this + network's cloud routers will only advertise routes with subnetworks + of this network in the same region as the router. If set to GLOBAL, + this network's cloud routers will advertise routes with all + subnetworks of this network, across regions. + Possible values are: REGIONAL, GLOBAL. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoCreateSubnetworks: Optional[bool] = None + """ + When set to true, the network is created in "auto subnet mode" and + it will create a subnet for each region automatically across the + 10.128.0.0/9 address range. + When set to false, the network is created in "custom subnet mode" so + the user can explicitly connect subnetwork resources. + """ + bgpAlwaysCompareMed: Optional[bool] = None + """ + Enables/disables the comparison of MED across routes with different Neighbor ASNs. + This value can only be set if the --bgp-best-path-selection-mode is STANDARD + """ + bgpBestPathSelectionMode: Optional[str] = None + """ + The BGP best selection algorithm to be employed. MODE can be LEGACY or STANDARD. + Possible values are: LEGACY, STANDARD. + """ + bgpInterRegionCost: Optional[str] = None + """ + Choice of the behavior of inter-regional cost and MED in the BPS algorithm. + Possible values are: DEFAULT, ADD_COST_TO_MED. + """ + deleteDefaultRoutesOnCreate: Optional[bool] = None + """ + If set to true, default routes (0.0.0.0/0) will be deleted + immediately after network creation. Defaults to false. + """ + description: Optional[str] = None + """ + An optional description of this resource. The resource must be + recreated to modify this field. + """ + enableUlaInternalIpv6: Optional[bool] = None + """ + Enable ULA internal ipv6 on this network. Enabling this feature will assign + a /48 from google defined ULA prefix fd20::/20. + """ + gatewayIpv4: Optional[str] = None + """ + The gateway address for default routing out of the network. This value + is selected by GCP. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/networks/{{name}} + """ + internalIpv6Range: Optional[str] = None + """ + When enabling ula internal ipv6, caller optionally can specify the /48 range + they want from the google defined ULA prefix fd20::/20. The input must be a + valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will + fail if the speficied /48 is already in used by another resource. + If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. + """ + mtu: Optional[float] = None + """ + Maximum Transmission Unit in bytes. The default value is 1460 bytes. + The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). + Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped + with an ICMP Fragmentation-Needed message if the packets are routed to the Internet or other VPCs + with varying MTUs. + """ + networkFirewallPolicyEnforcementOrder: Optional[str] = None + """ + Set the order that Firewall Rules and Firewall Policies are evaluated. + Default value is AFTER_CLASSIC_FIREWALL. + Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL. + """ + networkId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + networkProfile: Optional[str] = None + """ + A full or partial URL of the network profile to apply to this network. + This field can be set only at resource creation time. For example, the + following are valid URLs: + """ + numericId: Optional[str] = None + """ + (Deprecated) + The unique identifier for the resource. This identifier is defined by the server. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routingMode: Optional[str] = None + """ + The network-wide routing mode to use. If set to REGIONAL, this + network's cloud routers will only advertise routes with subnetworks + of this network in the same region as the router. If set to GLOBAL, + this network's cloud routers will advertise routes with all + subnetworks of this network, across regions. + Possible values are: REGIONAL, GLOBAL. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Network(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Network']] = 'Network' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkSpec defines the desired state of Network + """ + status: Optional[Status] = None + """ + NetworkStatus defines the observed state of Network. + """ + + +class NetworkList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Network] + """ + List of networks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkendpoint/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/networkendpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkendpoint/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/networkendpoint/v1beta1.py new file mode 100644 index 000000000..0381cb2ae --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/networkendpoint/v1beta1.py @@ -0,0 +1,389 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_networkendpoint.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NetworkEndpointGroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkEndpointGroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + instance: Optional[str] = None + """ + The name for a specific VM instance that the IP address belongs to. + This is required for network endpoints of type GCE_VM_IP_PORT. + The instance must be in the same zone of network endpoint group. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + ipAddress: Optional[str] = None + """ + IPv4 address of network endpoint. The IP address must belong + to a VM in GCE (either the primary IP or as part of an aliased IP + range). + """ + networkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + networkEndpointGroupRef: Optional[NetworkEndpointGroupRef] = None + """ + Reference to a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + networkEndpointGroupSelector: Optional[NetworkEndpointGroupSelector] = None + """ + Selector for a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + Note port is required unless the Network Endpoint Group is created + with the type of GCE_VM_IP + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + Zone where the containing network endpoint group is located. + """ + + +class InitProvider(BaseModel): + instance: Optional[str] = None + """ + The name for a specific VM instance that the IP address belongs to. + This is required for network endpoints of type GCE_VM_IP_PORT. + The instance must be in the same zone of network endpoint group. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + ipAddress: Optional[str] = None + """ + IPv4 address of network endpoint. The IP address must belong + to a VM in GCE (either the primary IP or as part of an aliased IP + range). + """ + networkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + networkEndpointGroupRef: Optional[NetworkEndpointGroupRef] = None + """ + Reference to a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + networkEndpointGroupSelector: Optional[NetworkEndpointGroupSelector] = None + """ + Selector for a NetworkEndpointGroup in compute to populate networkEndpointGroup. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + Note port is required unless the Network Endpoint Group is created + with the type of GCE_VM_IP + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + Zone where the containing network endpoint group is located. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}} + """ + instance: Optional[str] = None + """ + The name for a specific VM instance that the IP address belongs to. + This is required for network endpoints of type GCE_VM_IP_PORT. + The instance must be in the same zone of network endpoint group. + """ + ipAddress: Optional[str] = None + """ + IPv4 address of network endpoint. The IP address must belong + to a VM in GCE (either the primary IP or as part of an aliased IP + range). + """ + networkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + Note port is required unless the Network Endpoint Group is created + with the type of GCE_VM_IP + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: Optional[str] = None + """ + Zone where the containing network endpoint group is located. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkEndpoint(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkEndpoint']] = 'NetworkEndpoint' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkEndpointSpec defines the desired state of NetworkEndpoint + """ + status: Optional[Status] = None + """ + NetworkEndpointStatus defines the observed state of NetworkEndpoint. + """ + + +class NetworkEndpointList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkEndpoint] + """ + List of networkendpoints. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkendpointgroup/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/networkendpointgroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkendpointgroup/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/networkendpointgroup/v1beta1.py new file mode 100644 index 000000000..220c6a44c --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/networkendpointgroup/v1beta1.py @@ -0,0 +1,427 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_networkendpointgroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + The network to which all network endpoints in the NEG belong. + Uses "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + NON_GCP_PRIVATE_IP_PORT is used for hybrid connectivity network + endpoint groups (see https://cloud.google.com/load-balancing/docs/hybrid). + Note that NON_GCP_PRIVATE_IP_PORT can only be used with Backend Services + that 1) have the following load balancing schemes: EXTERNAL, EXTERNAL_MANAGED, + INTERNAL_MANAGED, and INTERNAL_SELF_MANAGED and 2) support the RATE or + CONNECTION balancing modes. + Possible values include: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, and PRIVATE_SERVICE_CONNECT. + Default value is GCE_VM_IP_PORT. + Possible values are: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + subnetwork: Optional[str] = None + """ + Optional subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + zone: str + """ + Zone where the network endpoint group is located. + """ + + +class InitProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + The network to which all network endpoints in the NEG belong. + Uses "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + NON_GCP_PRIVATE_IP_PORT is used for hybrid connectivity network + endpoint groups (see https://cloud.google.com/load-balancing/docs/hybrid). + Note that NON_GCP_PRIVATE_IP_PORT can only be used with Backend Services + that 1) have the following load balancing schemes: EXTERNAL, EXTERNAL_MANAGED, + INTERNAL_MANAGED, and INTERNAL_SELF_MANAGED and 2) support the RATE or + CONNECTION balancing modes. + Possible values include: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, and PRIVATE_SERVICE_CONNECT. + Default value is GCE_VM_IP_PORT. + Possible values are: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + subnetwork: Optional[str] = None + """ + Optional subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + defaultPort: Optional[float] = None + """ + The default port used if the port number is not specified in the + network endpoint. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + generatedId: Optional[float] = None + """ + The uniquely generated identifier for the resource. This identifier is defined by the server. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{name}} + """ + network: Optional[str] = None + """ + The network to which all network endpoints in the NEG belong. + Uses "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. + NON_GCP_PRIVATE_IP_PORT is used for hybrid connectivity network + endpoint groups (see https://cloud.google.com/load-balancing/docs/hybrid). + Note that NON_GCP_PRIVATE_IP_PORT can only be used with Backend Services + that 1) have the following load balancing schemes: EXTERNAL, EXTERNAL_MANAGED, + INTERNAL_MANAGED, and INTERNAL_SELF_MANAGED and 2) support the RATE or + CONNECTION balancing modes. + Possible values include: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, and PRIVATE_SERVICE_CONNECT. + Default value is GCE_VM_IP_PORT. + Possible values are: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Number of network endpoints in the network endpoint group. + """ + subnetwork: Optional[str] = None + """ + Optional subnetwork to which all network endpoints in the NEG belong. + """ + zone: Optional[str] = None + """ + Zone where the network endpoint group is located. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkEndpointGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkEndpointGroup']] = 'NetworkEndpointGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkEndpointGroupSpec defines the desired state of NetworkEndpointGroup + """ + status: Optional[Status] = None + """ + NetworkEndpointGroupStatus defines the observed state of NetworkEndpointGroup. + """ + + +class NetworkEndpointGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkEndpointGroup] + """ + List of networkendpointgroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicy/v1beta1.py new file mode 100644 index 000000000..12e201517 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicy/v1beta1.py @@ -0,0 +1,228 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_networkfirewallpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of the resource. This field is used internally during updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewallPolicies/{{name}} + """ + networkFirewallPolicyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleTupleCount: Optional[float] = None + """ + Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkFirewallPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkFirewallPolicy']] = 'NetworkFirewallPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkFirewallPolicySpec defines the desired state of NetworkFirewallPolicy + """ + status: Optional[Status] = None + """ + NetworkFirewallPolicyStatus defines the observed state of NetworkFirewallPolicy. + """ + + +class NetworkFirewallPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkFirewallPolicy] + """ + List of networkfirewallpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyassociation/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyassociation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyassociation/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyassociation/v1beta1.py new file mode 100644 index 000000000..42194da63 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyassociation/v1beta1.py @@ -0,0 +1,329 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_networkfirewallpolicyassociation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class AttachmentTargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class AttachmentTargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shortName: Optional[str] = None + """ + The short name of the firewall policy of the association. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkFirewallPolicyAssociation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkFirewallPolicyAssociation']] = ( + 'NetworkFirewallPolicyAssociation' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkFirewallPolicyAssociationSpec defines the desired state of NetworkFirewallPolicyAssociation + """ + status: Optional[Status] = None + """ + NetworkFirewallPolicyAssociationStatus defines the observed state of NetworkFirewallPolicyAssociation. + """ + + +class NetworkFirewallPolicyAssociationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkFirewallPolicyAssociation] + """ + List of networkfirewallpolicyassociations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyrule/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyrule/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyrule/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyrule/v1beta1.py new file mode 100644 index 000000000..e0116b03b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/networkfirewallpolicyrule/v1beta1.py @@ -0,0 +1,698 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_networkfirewallpolicyrule.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Layer4Config(BaseModel): + ipProtocol: Optional[str] = None + """ + The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. + This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + """ + ports: Optional[List[str]] = None + """ + An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + """ + + +class SrcAddressGroupsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SrcAddressGroupsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SrcSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a TagValue in tags to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a TagValue in tags to populate name. + """ + + +class Match(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcAddressGroupsRefs: Optional[List[SrcAddressGroupsRef]] = None + """ + References to AddressGroup in networksecurity to populate srcAddressGroups. + """ + srcAddressGroupsSelector: Optional[SrcAddressGroupsSelector] = None + """ + Selector for a list of AddressGroup in networksecurity to populate srcAddressGroups. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTag]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTag(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + + +class ForProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a NetworkFirewallPolicy in compute to populate firewallPolicy. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: float + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleName: Optional[str] = None + """ + An optional name for the rule. This field is not a unique identifier and can be updated. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class InitProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleName: Optional[str] = None + """ + An optional name for the rule. This field is not a unique identifier and can be updated. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetSecureTags: Optional[List[TargetSecureTag]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SrcSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class MatchModel(BaseModel): + destAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + """ + destFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + """ + destIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + """ + destRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + """ + destThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + """ + layer4Configs: Optional[List[Layer4Config]] = None + """ + Pairs of IP protocols and ports that the rule should match. + Structure is documented below. + """ + srcAddressGroups: Optional[List[str]] = None + """ + Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + """ + srcFqdns: Optional[List[str]] = None + """ + Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + """ + srcIpRanges: Optional[List[str]] = None + """ + CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + """ + srcRegionCodes: Optional[List[str]] = None + """ + Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + """ + srcSecureTags: Optional[List[SrcSecureTagModel]] = None + """ + List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + Structure is documented below. + """ + srcThreatIntelligences: Optional[List[str]] = None + """ + Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + """ + + +class TargetSecureTagModel(BaseModel): + name: Optional[str] = None + """ + Name of the secure tag, created with TagManager's TagValue API. + """ + state: Optional[str] = None + """ + (Output) + State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted. + """ + + +class AtProvider(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny", "goto_next" and "apply_security_profile_group". + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description for this resource. + """ + direction: Optional[str] = None + """ + The direction in which this rule applies. + Possible values are: INGRESS, EGRESS. + """ + disabled: Optional[bool] = None + """ + Denotes whether the firewall policy rule is disabled. + When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. + If this is unspecified, the firewall policy rule will be enabled. + """ + enableLogging: Optional[bool] = None + """ + Denotes whether to enable logging for a particular rule. + If logging is enabled, logs will be exported to the configured export destination in Stackdriver. + Logs may be exported to BigQuery or Pub/Sub. + Note: you cannot enable logging on "goto_next" rules. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}} + """ + kind: Optional[str] = None + """ + Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + """ + match: Optional[MatchModel] = None + """ + A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + ruleName: Optional[str] = None + """ + An optional name for the rule. This field is not a unique identifier and can be updated. + """ + ruleTupleCount: Optional[float] = None + """ + Calculation of the complexity of a single firewall policy rule. + """ + securityProfileGroup: Optional[str] = None + """ + A fully-qualified URL of a SecurityProfile resource instance. + Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group + Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + """ + targetSecureTags: Optional[List[TargetSecureTagModel]] = None + """ + A list of secure tags that controls which instances the firewall rule applies to. + If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. + targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + Structure is documented below. + """ + targetServiceAccounts: Optional[List[str]] = None + """ + A list of service accounts indicating the sets of instances that are applied with this rule. + """ + tlsInspect: Optional[bool] = None + """ + Boolean flag indicating if the traffic should be TLS decrypted. + Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkFirewallPolicyRule(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkFirewallPolicyRule']] = 'NetworkFirewallPolicyRule' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkFirewallPolicyRuleSpec defines the desired state of NetworkFirewallPolicyRule + """ + status: Optional[Status] = None + """ + NetworkFirewallPolicyRuleStatus defines the observed state of NetworkFirewallPolicyRule. + """ + + +class NetworkFirewallPolicyRuleList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkFirewallPolicyRule] + """ + List of networkfirewallpolicyrules. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkpeering/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/networkpeering/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkpeering/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/networkpeering/v1beta1.py new file mode 100644 index 000000000..a62b66704 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/networkpeering/v1beta1.py @@ -0,0 +1,380 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_networkpeering.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PeerNetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeerNetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. Defaults to false. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes from the peer network. Defaults to false. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field. + """ + network: Optional[str] = None + """ + The primary network of the peering. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + peerNetwork: Optional[str] = None + """ + The peer network in the peering. The peer network + may belong to a different project. + """ + peerNetworkRef: Optional[PeerNetworkRef] = None + """ + Reference to a Network in compute to populate peerNetwork. + """ + peerNetworkSelector: Optional[PeerNetworkSelector] = None + """ + Selector for a Network in compute to populate peerNetwork. + """ + stackType: Optional[str] = None + """ + Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"]. + """ + + +class InitProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. Defaults to false. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes from the peer network. Defaults to false. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field. + """ + peerNetwork: Optional[str] = None + """ + The peer network in the peering. The peer network + may belong to a different project. + """ + peerNetworkRef: Optional[PeerNetworkRef] = None + """ + Reference to a Network in compute to populate peerNetwork. + """ + peerNetworkSelector: Optional[PeerNetworkSelector] = None + """ + Selector for a Network in compute to populate peerNetwork. + """ + stackType: Optional[str] = None + """ + Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"]. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. Defaults to false. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{network}}/{{name}} + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes from the peer network. Defaults to false. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field. + """ + network: Optional[str] = None + """ + The primary network of the peering. + """ + peerNetwork: Optional[str] = None + """ + The peer network in the peering. The peer network + may belong to a different project. + """ + stackType: Optional[str] = None + """ + Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"]. + """ + state: Optional[str] = None + """ + State for the peering, either ACTIVE or INACTIVE. The peering is + ACTIVE when there's a matching configuration in the peer network. + """ + stateDetails: Optional[str] = None + """ + Details about the current state of the peering. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkPeering(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkPeering']] = 'NetworkPeering' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkPeeringSpec defines the desired state of NetworkPeering + """ + status: Optional[Status] = None + """ + NetworkPeeringStatus defines the observed state of NetworkPeering. + """ + + +class NetworkPeeringList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkPeering] + """ + List of networkpeerings. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkpeeringroutesconfig/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/networkpeeringroutesconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/networkpeeringroutesconfig/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/networkpeeringroutesconfig/v1beta1.py new file mode 100644 index 000000000..ef286b869 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/networkpeeringroutesconfig/v1beta1.py @@ -0,0 +1,395 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_networkpeeringroutesconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PeeringRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeeringSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. + IPv4 special-use ranges are always exported to peers and + are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes to the peer network. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. + IPv4 special-use ranges are always imported from peers and + are not controlled by this field. + """ + network: Optional[str] = None + """ + The name of the primary network for the peering. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + peering: Optional[str] = None + """ + Name of the peering. + """ + peeringRef: Optional[PeeringRef] = None + """ + Reference to a NetworkPeering in compute to populate peering. + """ + peeringSelector: Optional[PeeringSelector] = None + """ + Selector for a NetworkPeering in compute to populate peering. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. + IPv4 special-use ranges are always exported to peers and + are not controlled by this field. + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes to the peer network. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. + IPv4 special-use ranges are always imported from peers and + are not controlled by this field. + """ + network: Optional[str] = None + """ + The name of the primary network for the peering. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + peering: Optional[str] = None + """ + Name of the peering. + """ + peeringRef: Optional[PeeringRef] = None + """ + Reference to a NetworkPeering in compute to populate peering. + """ + peeringSelector: Optional[PeeringSelector] = None + """ + Selector for a NetworkPeering in compute to populate peering. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + exportCustomRoutes: Optional[bool] = None + """ + Whether to export the custom routes to the peer network. + """ + exportSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are exported. + IPv4 special-use ranges are always exported to peers and + are not controlled by this field. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/networks/{{network}}/networkPeerings/{{peering}} + """ + importCustomRoutes: Optional[bool] = None + """ + Whether to import the custom routes to the peer network. + """ + importSubnetRoutesWithPublicIp: Optional[bool] = None + """ + Whether subnet routes with public IP range are imported. + IPv4 special-use ranges are always imported from peers and + are not controlled by this field. + """ + network: Optional[str] = None + """ + The name of the primary network for the peering. + """ + peering: Optional[str] = None + """ + Name of the peering. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NetworkPeeringRoutesConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NetworkPeeringRoutesConfig']] = 'NetworkPeeringRoutesConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NetworkPeeringRoutesConfigSpec defines the desired state of NetworkPeeringRoutesConfig + """ + status: Optional[Status] = None + """ + NetworkPeeringRoutesConfigStatus defines the observed state of NetworkPeeringRoutesConfig. + """ + + +class NetworkPeeringRoutesConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NetworkPeeringRoutesConfig] + """ + List of networkpeeringroutesconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/nodegroup/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/nodegroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/nodegroup/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/nodegroup/v1beta1.py new file mode 100644 index 000000000..7d025c99f --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/nodegroup/v1beta1.py @@ -0,0 +1,524 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_nodegroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AutoscalingPolicy(BaseModel): + maxNodes: Optional[float] = None + """ + Maximum size of the node group. Set to a value less than or equal + to 100 and greater than or equal to min-nodes. + """ + minNodes: Optional[float] = None + """ + Minimum size of the node group. Must be less + than or equal to max-nodes. The default value is 0. + """ + mode: Optional[str] = None + """ + The autoscaling mode. Set to one of the following: + """ + + +class MaintenanceWindow(BaseModel): + startTime: Optional[str] = None + """ + instances.start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NodeTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NodeTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class IdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class IdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectIdRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectIdSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ProjectMapItem(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + idRef: Optional[IdRef] = None + """ + Reference to a Project in cloudplatform to populate id. + """ + idSelector: Optional[IdSelector] = None + """ + Selector for a Project in cloudplatform to populate id. + """ + projectId: Optional[str] = None + """ + The project id/number should be the same as the key of this project config in the project map. + """ + projectIdRef: Optional[ProjectIdRef] = None + """ + Reference to a Project in cloudplatform to populate projectId. + """ + projectIdSelector: Optional[ProjectIdSelector] = None + """ + Selector for a Project in cloudplatform to populate projectId. + """ + + +class ShareSettings(BaseModel): + projectMap: Optional[List[ProjectMapItem]] = None + """ + A map of project id and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. + Structure is documented below. + """ + shareType: Optional[str] = None + """ + Node group sharing type. + Possible values are: ORGANIZATION, SPECIFIC_PROJECTS, LOCAL. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[MaintenanceWindow] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + nodeTemplateRef: Optional[NodeTemplateRef] = None + """ + Reference to a NodeTemplate in compute to populate nodeTemplate. + """ + nodeTemplateSelector: Optional[NodeTemplateSelector] = None + """ + Selector for a NodeTemplate in compute to populate nodeTemplate. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shareSettings: Optional[ShareSettings] = None + """ + Share settings for the node group. + Structure is documented below. + """ + zone: str + """ + Zone where this node group is located + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[MaintenanceWindow] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + nodeTemplateRef: Optional[NodeTemplateRef] = None + """ + Reference to a NodeTemplate in compute to populate nodeTemplate. + """ + nodeTemplateSelector: Optional[NodeTemplateSelector] = None + """ + Selector for a NodeTemplate in compute to populate nodeTemplate. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + shareSettings: Optional[ShareSettings] = None + """ + Share settings for the node group. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ProjectMapItemModel(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + projectId: Optional[str] = None + """ + The project id/number should be the same as the key of this project config in the project map. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + If you use sole-tenant nodes for your workloads, you can use the node + group autoscaler to automatically manage the sizes of your node groups. + One of initial_size or autoscaling_policy must be configured on resource creation. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}} + """ + initialSize: Optional[float] = None + """ + The initial number of nodes in the node group. One of initial_size or autoscaling_policy must be configured on resource creation. + """ + maintenancePolicy: Optional[str] = None + """ + Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. + """ + maintenanceWindow: Optional[MaintenanceWindow] = None + """ + contains properties for the timeframe of maintenance + Structure is documented below. + """ + nodeTemplate: Optional[str] = None + """ + The URL of the node template to which this node group belongs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shareSettings: Optional[ShareSettings] = None + """ + Share settings for the node group. + Structure is documented below. + """ + size: Optional[float] = None + """ + The total number of nodes in the node group. + """ + zone: Optional[str] = None + """ + Zone where this node group is located + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodeGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NodeGroup']] = 'NodeGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodeGroupSpec defines the desired state of NodeGroup + """ + status: Optional[Status] = None + """ + NodeGroupStatus defines the observed state of NodeGroup. + """ + + +class NodeGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodeGroup] + """ + List of nodegroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/nodetemplate/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/nodetemplate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/nodetemplate/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/nodetemplate/v1beta1.py new file mode 100644 index 000000000..c3e47a01e --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/nodetemplate/v1beta1.py @@ -0,0 +1,421 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_nodetemplate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Accelerator(BaseModel): + acceleratorCount: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this + node template. + """ + acceleratorType: Optional[str] = None + """ + Full or partial URL of the accelerator type resource to expose + to this node template. + """ + + +class Disk(BaseModel): + diskCount: Optional[float] = None + """ + Specifies the number of such disks. + """ + diskSizeGb: Optional[float] = None + """ + Specifies the size of the disk in base-2 GB. + """ + diskType: Optional[str] = None + """ + Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + """ + + +class NodeTypeFlexibility(BaseModel): + cpus: Optional[str] = None + """ + Number of virtual CPUs to use. + """ + memory: Optional[str] = None + """ + Physical memory available to the node, defined in MB. + """ + + +class ServerBinding(BaseModel): + type: Optional[str] = None + """ + Type of server binding policy. If RESTART_NODE_ON_ANY_SERVER, + nodes using this template will restart on any physical server + following a maintenance event. + If RESTART_NODE_ON_MINIMAL_SERVER, nodes using this template + will restart on the same physical server following a maintenance + event, instead of being live migrated to or restarted on a new + physical server. This option may be useful if you are using + software licenses tied to the underlying server characteristics + such as physical sockets or cores, to avoid the need for + additional licenses when maintenance occurs. However, VMs on such + nodes will experience outages while maintenance is applied. + Possible values are: RESTART_NODE_ON_ANY_SERVER, RESTART_NODE_ON_MINIMAL_SERVERS. + """ + + +class ForProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[NodeTypeFlexibility] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where nodes using the node template will be created. + If it is not provided, the provider region is used. + """ + serverBinding: Optional[ServerBinding] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[NodeTypeFlexibility] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + serverBinding: Optional[ServerBinding] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class NodeTypeFlexibilityModel(BaseModel): + cpus: Optional[str] = None + """ + Number of virtual CPUs to use. + """ + localSsd: Optional[str] = None + """ + (Output) + Use local SSD + """ + memory: Optional[str] = None + """ + Physical memory available to the node, defined in MB. + """ + + +class AtProvider(BaseModel): + accelerators: Optional[List[Accelerator]] = None + """ + List of the type and count of accelerator cards attached to the + node template + Structure is documented below. + """ + cpuOvercommitType: Optional[str] = None + """ + CPU overcommit. + Default value is NONE. + Possible values are: ENABLED, NONE. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the resource. + """ + disks: Optional[List[Disk]] = None + """ + List of the type, size and count of disks attached to the + node template + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}} + """ + nodeAffinityLabels: Optional[Dict[str, str]] = None + """ + Labels to use for node affinity, which will be used in + instance scheduling. + """ + nodeType: Optional[str] = None + """ + Node type to use for nodes group that are created from this template. + Only one of nodeTypeFlexibility and nodeType can be specified. + """ + nodeTypeFlexibility: Optional[NodeTypeFlexibilityModel] = None + """ + Flexible properties for the desired node type. Node groups that + use this node template will create nodes of a type that matches + these properties. Only one of nodeTypeFlexibility and nodeType can + be specified. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where nodes using the node template will be created. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serverBinding: Optional[ServerBinding] = None + """ + The server binding policy for nodes using this template. Determines + where the nodes should restart following a maintenance event. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodeTemplate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NodeTemplate']] = 'NodeTemplate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodeTemplateSpec defines the desired state of NodeTemplate + """ + status: Optional[Status] = None + """ + NodeTemplateStatus defines the observed state of NodeTemplate. + """ + + +class NodeTemplateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodeTemplate] + """ + List of nodetemplates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/packetmirroring/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/packetmirroring/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/packetmirroring/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/packetmirroring/v1beta1.py new file mode 100644 index 000000000..c2035b2d7 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/packetmirroring/v1beta1.py @@ -0,0 +1,467 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_packetmirroring.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CollectorIlb(BaseModel): + url: Optional[str] = None + """ + The URL of the forwarding rule. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a ForwardingRule in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a ForwardingRule in compute to populate url. + """ + + +class Filter(BaseModel): + cidrRanges: Optional[List[str]] = None + """ + IP CIDR ranges that apply as a filter on the source (ingress) or + destination (egress) IP in the IP header. Only IPv4 is supported. + """ + direction: Optional[str] = None + """ + Direction of traffic to mirror. + Default value is BOTH. + Possible values are: INGRESS, EGRESS, BOTH. + """ + ipProtocols: Optional[List[str]] = None + """ + Possible IP protocols including tcp, udp, icmp and esp + """ + + +class Instance(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a Instance in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a Instance in compute to populate url. + """ + + +class Subnetwork(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + + +class MirroredResources(BaseModel): + instances: Optional[List[Instance]] = None + """ + All the listed instances will be mirrored. Specify at most 50. + Structure is documented below. + """ + subnetworks: Optional[List[Subnetwork]] = None + """ + All instances in one of these subnetworks will be mirrored. + Structure is documented below. + """ + tags: Optional[List[str]] = None + """ + All instances with these tags will be mirrored. + """ + + +class Network(BaseModel): + url: Optional[str] = None + """ + The full self_link URL of the network where this rule is active. + """ + urlRef: Optional[UrlRef] = None + """ + Reference to a Network in compute to populate url. + """ + urlSelector: Optional[UrlSelector] = None + """ + Selector for a Network in compute to populate url. + """ + + +class ForProvider(BaseModel): + collectorIlb: Optional[CollectorIlb] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[Filter] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + mirroredResources: Optional[MirroredResources] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[Network] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + + +class InitProvider(BaseModel): + collectorIlb: Optional[CollectorIlb] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[Filter] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + mirroredResources: Optional[MirroredResources] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[Network] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CollectorIlbModel(BaseModel): + url: Optional[str] = None + """ + The URL of the forwarding rule. + """ + + +class InstanceModel(BaseModel): + url: Optional[str] = None + """ + The URL of the subnetwork where this rule should be active. + """ + + +class NetworkModel(BaseModel): + url: Optional[str] = None + """ + The full self_link URL of the network where this rule is active. + """ + + +class AtProvider(BaseModel): + collectorIlb: Optional[CollectorIlbModel] = None + """ + The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL) + that will be used as collector for mirrored traffic. The + specified forwarding rule must have is_mirroring_collector + set to true. + Structure is documented below. + """ + description: Optional[str] = None + """ + A human-readable description of the rule. + """ + filter: Optional[Filter] = None + """ + A filter for mirrored traffic. If unset, all traffic is mirrored. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/packetMirrorings/{{name}} + """ + mirroredResources: Optional[MirroredResources] = None + """ + A means of specifying which resources to mirror. + Structure is documented below. + """ + network: Optional[NetworkModel] = None + """ + Specifies the mirrored VPC network. Only packets in this network + will be mirrored. All mirrored VMs should have a NIC in the given + network. All mirrored subnetworks should belong to the given network. + Structure is documented below. + """ + priority: Optional[float] = None + """ + Since only one rule can be active at a time, priority is + used to break ties in the case of two rules that apply to + the same instances. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created address should reside. + If it is not provided, the provider region is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class PacketMirroring(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['PacketMirroring']] = 'PacketMirroring' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + PacketMirroringSpec defines the desired state of PacketMirroring + """ + status: Optional[Status] = None + """ + PacketMirroringStatus defines the observed state of PacketMirroring. + """ + + +class PacketMirroringList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[PacketMirroring] + """ + List of packetmirrorings. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/perinstanceconfig/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/perinstanceconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/perinstanceconfig/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/perinstanceconfig/v1beta1.py new file mode 100644 index 000000000..105aee142 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/perinstanceconfig/v1beta1.py @@ -0,0 +1,589 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_perinstanceconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceGroupManagerRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceGroupManagerSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + + +class IpAddress(BaseModel): + address: Optional[str] = None + """ + The URL of the reservation for this IP address. + """ + + +class ExternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class InternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class PreservedState(BaseModel): + disk: Optional[List[DiskItem]] = None + """ + Stateful disks for the instance. + Structure is documented below. + """ + externalIp: Optional[List[ExternalIpItem]] = None + """ + Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + internalIp: Optional[List[InternalIpItem]] = None + """ + Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + metadata: Optional[Dict[str, str]] = None + """ + Preserved metadata defined for this instance. This is a list of key->value pairs. + """ + + +class ZoneRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ZoneSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + instanceGroupManagerRef: Optional[InstanceGroupManagerRef] = None + """ + Reference to a InstanceGroupManager in compute to populate instanceGroupManager. + """ + instanceGroupManagerSelector: Optional[InstanceGroupManagerSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate instanceGroupManager. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + zoneRef: Optional[ZoneRef] = None + """ + Reference to a InstanceGroupManager in compute to populate zone. + """ + zoneSelector: Optional[ZoneSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate zone. + """ + + +class InitProvider(BaseModel): + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + instanceGroupManagerRef: Optional[InstanceGroupManagerRef] = None + """ + Reference to a InstanceGroupManager in compute to populate instanceGroupManager. + """ + instanceGroupManagerSelector: Optional[InstanceGroupManagerSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate instanceGroupManager. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + zoneRef: Optional[ZoneRef] = None + """ + Reference to a InstanceGroupManager in compute to populate zone. + """ + zoneSelector: Optional[ZoneSelector] = None + """ + Selector for a InstanceGroupManager in compute to populate zone. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DiskItemModel(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{zone}}/{{instance_group_manager}}/{{name}} + """ + instanceGroupManager: Optional[str] = None + """ + The instance group manager this instance config is part of. + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + zone: Optional[str] = None + """ + Zone where the containing instance group manager is located + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class PerInstanceConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['PerInstanceConfig']] = 'PerInstanceConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + PerInstanceConfigSpec defines the desired state of PerInstanceConfig + """ + status: Optional[Status] = None + """ + PerInstanceConfigStatus defines the observed state of PerInstanceConfig. + """ + + +class PerInstanceConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[PerInstanceConfig] + """ + List of perinstanceconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/projectdefaultnetworktier/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/projectdefaultnetworktier/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/projectdefaultnetworktier/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/projectdefaultnetworktier/v1beta1.py new file mode 100644 index 000000000..96ad1fe03 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/projectdefaultnetworktier/v1beta1.py @@ -0,0 +1,207 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_projectdefaultnetworktier.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + networkTier: Optional[str] = None + """ + The default network tier to be configured for the project. + This field can take the following values: PREMIUM or STANDARD. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + networkTier: Optional[str] = None + """ + The default network tier to be configured for the project. + This field can take the following values: PREMIUM or STANDARD. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}} + """ + networkTier: Optional[str] = None + """ + The default network tier to be configured for the project. + This field can take the following values: PREMIUM or STANDARD. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectDefaultNetworkTier(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectDefaultNetworkTier']] = 'ProjectDefaultNetworkTier' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectDefaultNetworkTierSpec defines the desired state of ProjectDefaultNetworkTier + """ + status: Optional[Status] = None + """ + ProjectDefaultNetworkTierStatus defines the observed state of ProjectDefaultNetworkTier. + """ + + +class ProjectDefaultNetworkTierList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectDefaultNetworkTier] + """ + List of projectdefaultnetworktiers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/projectmetadata/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/projectmetadata/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/projectmetadata/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/projectmetadata/v1beta1.py new file mode 100644 index 000000000..a2c63295c --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/projectmetadata/v1beta1.py @@ -0,0 +1,204 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_projectmetadata.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + metadata: Optional[Dict[str, str]] = None + """ + A series of key value pairs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + metadata: Optional[Dict[str, str]] = None + """ + A series of key value pairs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}} + """ + metadata: Optional[Dict[str, str]] = None + """ + A series of key value pairs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectMetadata(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectMetadata']] = 'ProjectMetadata' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectMetadataSpec defines the desired state of ProjectMetadata + """ + status: Optional[Status] = None + """ + ProjectMetadataStatus defines the observed state of ProjectMetadata. + """ + + +class ProjectMetadataList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectMetadata] + """ + List of projectmetadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/projectmetadataitem/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/projectmetadataitem/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/projectmetadataitem/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/projectmetadataitem/v1beta1.py new file mode 100644 index 000000000..d6a6843e7 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/projectmetadataitem/v1beta1.py @@ -0,0 +1,216 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_projectmetadataitem.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + key: Optional[str] = None + """ + The metadata key to set. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + value: Optional[str] = None + """ + The value to set for the given metadata key. + """ + + +class InitProvider(BaseModel): + key: Optional[str] = None + """ + The metadata key to set. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + value: Optional[str] = None + """ + The value to set for the given metadata key. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format `{{key}}` + """ + key: Optional[str] = None + """ + The metadata key to set. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + value: Optional[str] = None + """ + The value to set for the given metadata key. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ProjectMetadataItem(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ProjectMetadataItem']] = 'ProjectMetadataItem' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ProjectMetadataItemSpec defines the desired state of ProjectMetadataItem + """ + status: Optional[Status] = None + """ + ProjectMetadataItemStatus defines the observed state of ProjectMetadataItem. + """ + + +class ProjectMetadataItemList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ProjectMetadataItem] + """ + List of projectmetadataitems. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionautoscaler/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionautoscaler/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionautoscaler/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionautoscaler/v1beta1.py new file mode 100644 index 000000000..b298a1e3d --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionautoscaler/v1beta1.py @@ -0,0 +1,527 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionautoscaler.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CpuUtilization(BaseModel): + predictiveMethod: Optional[str] = None + """ + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class LoadBalancingUtilization(BaseModel): + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class MetricItem(BaseModel): + filter: Optional[str] = None + """ + A filter string to be used as the filter string for + a Stackdriver Monitoring TimeSeries.list API call. + This filter is used to select a specific TimeSeries for + the purpose of autoscaling and to determine whether the metric + is exporting per-instance or per-group data. + You can only use the AND operator for joining selectors. + You can only use direct equality comparison operator (=) without + any functions for each selector. + You can specify the metric in both the filter string and in the + metric field. However, if specified in both places, the metric must + be identical. + The monitored resource type determines what kind of values are + expected for the metric. If it is a gce_instance, the autoscaler + expects the metric to include a separate TimeSeries for each + instance in a group. In such a case, you cannot filter on resource + labels. + If the resource type is any other value, the autoscaler expects + this metric to contain values that apply to the entire autoscaled + instance group and resource label filtering can be performed to + point autoscaler at the correct TimeSeries to scale upon. + This is called a per-group metric for the purpose of autoscaling. + If not specified, the type defaults to gce_instance. + You should provide a filter that is selective enough to pick just + one TimeSeries for the autoscaled group or for each of the instances + (if you are using gce_instance resource type). If multiple + TimeSeries are returned upon the query execution, the autoscaler + will sum their respective values to obtain its scaling value. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + singleInstanceAssignment: Optional[float] = None + """ + If scaling is based on a per-group metric value that represents the + total amount of work to be done or resource usage, set this value to + an amount assigned for a single instance of the scaled group. + The autoscaler will keep the number of instances proportional to the + value of this metric, the metric itself should not change value due + to group resizing. + For example, a good metric to use with the target is + pubsub.googleapis.com/subscription/num_undelivered_messages + or a custom metric exporting the total number of requests coming to + your instances. + A bad example would be a metric exporting an average or median + latency, since this value can't include a chunk assignable to a + single instance, it could be better used with utilization_target + instead. + """ + target: Optional[float] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + type: Optional[str] = None + """ + Defines how target utilization value is expressed for a + Stackdriver Monitoring metric. + Possible values are: GAUGE, DELTA_PER_SECOND, DELTA_PER_MINUTE. + """ + + +class MaxScaledInReplicas(BaseModel): + fixed: Optional[float] = None + """ + Specifies a fixed number of VM instances. This must be a positive + integer. + """ + percent: Optional[float] = None + """ + Specifies a percentage of instances between 0 to 100%, inclusive. + For example, specify 80 for 80%. + """ + + +class ScaleInControl(BaseModel): + maxScaledInReplicas: Optional[MaxScaledInReplicas] = None + """ + A nested object resource. + Structure is documented below. + """ + timeWindowSec: Optional[float] = None + """ + How long back autoscaling should look when computing recommendations + to include directives regarding slower scale down, as described above. + """ + + +class ScalingSchedule(BaseModel): + description: Optional[str] = None + """ + A description of a scaling schedule. + """ + disabled: Optional[bool] = None + """ + A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. + """ + durationSec: Optional[float] = None + """ + The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. + """ + minRequiredReplicas: Optional[float] = None + """ + Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. + """ + name: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + schedule: Optional[str] = None + """ + The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). + """ + timeZone: Optional[str] = None + """ + The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + + +class AutoscalingPolicy(BaseModel): + cooldownPeriod: Optional[float] = None + """ + The number of seconds that the autoscaler should wait before it + starts collecting information from a new instance. This prevents + the autoscaler from collecting information when the instance is + initializing, during which the collected usage would not be + reliable. The default time autoscaler waits is 60 seconds. + Virtual machine initialization times might vary because of + numerous factors. We recommend that you test how long an + instance may take to initialize. To do this, create an instance + and time the startup process. + """ + cpuUtilization: Optional[CpuUtilization] = None + """ + Defines the CPU utilization policy that allows the autoscaler to + scale based on the average CPU utilization of a managed instance + group. + Structure is documented below. + """ + loadBalancingUtilization: Optional[LoadBalancingUtilization] = None + """ + Configuration parameters of autoscaling based on a load balancer. + Structure is documented below. + """ + maxReplicas: Optional[float] = None + """ + The maximum number of instances that the autoscaler can scale up + to. This is required when creating or updating an autoscaler. The + maximum number of replicas should not be lower than minimal number + of replicas. + """ + metric: Optional[List[MetricItem]] = None + """ + Configuration parameters of autoscaling based on a custom metric. + Structure is documented below. + """ + minReplicas: Optional[float] = None + """ + The minimum number of replicas that the autoscaler can scale down + to. This cannot be less than 0. If not provided, autoscaler will + choose a default value depending on maximum number of instances + allowed. + """ + mode: Optional[str] = None + """ + Defines operating mode for this policy. + """ + scaleInControl: Optional[ScaleInControl] = None + """ + Defines scale in controls to reduce the risk of response latency + and outages due to abrupt scale-in events + Structure is documented below. + """ + scalingSchedules: Optional[List[ScalingSchedule]] = None + """ + Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class TargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + URL of the region where the instance group resides. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate target. + """ + + +class InitProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + targetRef: Optional[TargetRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate target. + """ + targetSelector: Optional[TargetSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate target. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + autoscalingPolicy: Optional[AutoscalingPolicy] = None + """ + The configuration parameters for the autoscaling algorithm. You can + define one or more of the policies for an autoscaler: cpuUtilization, + customMetricUtilizations, and loadBalancingUtilization. + If none of these are specified, the default will be to autoscale based + on cpuUtilization to 0.6 or 60%. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/autoscalers/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + URL of the region where the instance group resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + target: Optional[str] = None + """ + URL of the managed instance group that this autoscaler will scale. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionAutoscaler(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionAutoscaler']] = 'RegionAutoscaler' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionAutoscalerSpec defines the desired state of RegionAutoscaler + """ + status: Optional[Status] = None + """ + RegionAutoscalerStatus defines the observed state of RegionAutoscaler. + """ + + +class RegionAutoscalerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionAutoscaler] + """ + List of regionautoscalers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionbackendservice/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionbackendservice/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionbackendservice/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionbackendservice/v1beta1.py new file mode 100644 index 000000000..2143da004 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionbackendservice/v1beta1.py @@ -0,0 +1,1480 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionbackendservice.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CustomMetric(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class GroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class GroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class BackendItem(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + ~>NOTE: This field cannot be set for + INTERNAL region backend services (default loadBalancingScheme), + but is required for non-INTERNAL backend service. The total + capacity_scaler for all backends must be non-zero. + A setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetric]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + failover: Optional[bool] = None + """ + This field designates whether this is a failover backend. More + than one failover backend can be configured for a given RegionBackendService. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + When the load_balancing_scheme is INTERNAL, only instance groups + are supported. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + groupRef: Optional[GroupRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate group. + """ + groupSelector: Optional[GroupSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate group. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + Cannot be set for INTERNAL backend services. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. Cannot be set + for INTERNAL backend services. + This is used to calculate the capacity of the group. Can be + used in either CONNECTION or UTILIZATION balancing modes. For + CONNECTION mode, either maxConnections or + maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. Cannot be set for INTERNAL backend + services. + This is used to calculate the capacity of the group. + Can be used in either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. Cannot be set + for INTERNAL backend services. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. Either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. Cannot be set + for INTERNAL backend services. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. Cannot be set + for INTERNAL backend services. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + Cannot be set for INTERNAL backend services. + """ + + +class CacheKeyPolicy(BaseModel): + includeHost: Optional[bool] = None + """ + If true requests to different hosts will be cached separately. + """ + includeNamedCookies: Optional[List[str]] = None + """ + Names of cookies to include in cache keys. + """ + includeProtocol: Optional[bool] = None + """ + If true, http and https requests will be cached separately. + """ + includeQueryString: Optional[bool] = None + """ + If true, include query string parameters in the cache key + according to query_string_whitelist and + query_string_blacklist. If neither is set, the entire query + string will be included. + If false, the query string will be excluded from the cache + key entirely. + """ + queryStringBlacklist: Optional[List[str]] = None + """ + Names of query string parameters to exclude in cache keys. + All other parameters will be included. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + queryStringWhitelist: Optional[List[str]] = None + """ + Names of query string parameters to include in cache keys. + All other parameters will be excluded. Either specify + query_string_whitelist or query_string_blacklist, not both. + '&' and '=' will be percent encoded and not treated as + delimiters. + """ + + +class NegativeCachingPolicyItem(BaseModel): + code: Optional[float] = None + """ + The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 308, 404, 405, 410, 421, 451 and 501 + can be specified as values, and you cannot specify a status code more than once. + """ + + +class CdnPolicy(BaseModel): + cacheKeyPolicy: Optional[CacheKeyPolicy] = None + """ + The CacheKeyPolicy for this CdnPolicy. + Structure is documented below. + """ + cacheMode: Optional[str] = None + """ + Specifies the cache setting for all responses from this backend. + The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC + Possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL, CACHE_ALL_STATIC. + """ + clientTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + defaultTtl: Optional[float] = None + """ + Specifies the default TTL for cached content served by this origin for responses + that do not have an existing valid TTL (max-age or s-max-age). + """ + maxTtl: Optional[float] = None + """ + Specifies the maximum allowed TTL for cached content served by this origin. + """ + negativeCaching: Optional[bool] = None + """ + Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. + """ + negativeCachingPolicy: Optional[List[NegativeCachingPolicyItem]] = None + """ + Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy. + Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs. + Structure is documented below. + """ + serveWhileStale: Optional[float] = None + """ + Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. + """ + signedUrlCacheMaxAgeSec: Optional[float] = None + """ + Maximum number of seconds the response to a signed URL request + will be considered fresh, defaults to 1hr (3600s). After this + time period, the response will be revalidated before + being served. + When serving responses to signed URL requests, Cloud CDN will + internally behave as though all responses from this backend had a + "Cache-Control: public, max-age=[TTL]" header, regardless of any + existing Cache-Control header. The actual headers served in + responses will not be altered. + """ + + +class CircuitBreakers(BaseModel): + maxConnections: Optional[float] = None + """ + The maximum number of connections to the backend cluster. + Defaults to 1024. + """ + maxPendingRequests: Optional[float] = None + """ + The maximum number of pending requests to the backend cluster. + Defaults to 1024. + """ + maxRequests: Optional[float] = None + """ + The maximum number of parallel requests to the backend cluster. + Defaults to 1024. + """ + maxRequestsPerConnection: Optional[float] = None + """ + Maximum requests for a single backend connection. This parameter + is respected by both the HTTP/1.1 and HTTP/2 implementations. If + not specified, there is no limit. Setting this parameter to 1 + will effectively disable keep alive. + """ + maxRetries: Optional[float] = None + """ + The maximum number of parallel retries to the backend cluster. + Defaults to 3. + """ + + +class Ttl(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class HttpCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ConsistentHash(BaseModel): + httpCookie: Optional[HttpCookie] = None + """ + Hash is based on HTTP Cookie. This field describes a HTTP cookie + that will be used as the hash key for the consistent hash load + balancer. If the cookie is not present, it will be generated. + This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + Structure is documented below. + """ + httpHeaderName: Optional[str] = None + """ + The hash based on the value of the specified header field. + This field is applicable if the sessionAffinity is set to HEADER_FIELD. + """ + minimumRingSize: Optional[float] = None + """ + The minimum number of virtual nodes to use for the hash ring. + Larger ring sizes result in more granular load + distributions. If the number of hosts in the load balancing pool + is larger than the ring size, each host will be assigned a single + virtual node. + Defaults to 1024. + """ + + +class CustomMetricModel(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class FailoverPolicy(BaseModel): + disableConnectionDrainOnFailover: Optional[bool] = None + """ + On failover or failback, this field indicates whether connection drain + will be honored. Setting this to true has the following effect: connections + to the old active pool are not drained. Connections to the new active pool + use the timeout of 10 min (currently fixed). Setting to false has the + following effect: both old and new connections will have a drain timeout + of 10 min. + This can be set to true only if the protocol is TCP. + The default is false. + """ + dropTrafficIfUnhealthy: Optional[bool] = None + """ + This option is used only when no healthy VMs are detected in the primary + and backup instance groups. When set to true, traffic is dropped. When + set to false, new connections are sent across all VMs in the primary group. + The default is false. + """ + failoverRatio: Optional[float] = None + """ + The value of the field must be in [0, 1]. If the ratio of the healthy + VMs in the primary backend is at or below this number, traffic arriving + at the load-balanced IP will be directed to the failover backend. + In case where 'failoverRatio' is not set or all the VMs in the backup + backend are unhealthy, the traffic will be directed back to the primary + backend in the "force" mode, where traffic will be spread to the healthy + VMs with the best effort, or to all VMs when no VM is healthy. + This field is only used with l4 load balancing. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Oauth2ClientSecretSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class Iap(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + oauth2ClientSecretSecretRef: Optional[Oauth2ClientSecretSecretRef] = None + """ + OAuth2 Client Secret for IAP + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Whether to enable logging for the load balancer traffic served by this backend service. + """ + optionalFields: Optional[List[str]] = None + """ + Specifies the fields to include in logging. This field can only be specified if logging is enabled for this backend service. + """ + optionalMode: Optional[str] = None + """ + Specifies the optional logging mode for the load balancer traffic. + Supported values: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + Possible values are: INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM. + """ + sampleRate: Optional[float] = None + """ + This field can only be specified if logging is enabled for this backend service. The value of + the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer + where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. + The default value is 1.0. + """ + + +class BaseEjectionTime(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class Interval(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond + resolution. Durations less than one second are represented + with a 0 seconds field and a positive nanos field. Must + be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[float] = None + """ + Span of time at a resolution of a second. + Must be from 0 to 315,576,000,000 inclusive. + """ + + +class OutlierDetection(BaseModel): + baseEjectionTime: Optional[BaseEjectionTime] = None + """ + The base time that a host is ejected for. The real time is equal to the base + time multiplied by the number of times the host has been ejected. Defaults to + 30000ms or 30s. + Structure is documented below. + """ + consecutiveErrors: Optional[float] = None + """ + Number of errors before a host is ejected from the connection pool. When the + backend host is accessed over HTTP, a 5xx return code qualifies as an error. + Defaults to 5. + """ + consecutiveGatewayFailure: Optional[float] = None + """ + The number of consecutive gateway failures (502, 503, 504 status or connection + errors that are mapped to one of those status codes) before a consecutive + gateway failure ejection occurs. Defaults to 5. + """ + enforcingConsecutiveErrors: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive 5xx. This setting can be used to disable + ejection or to ramp it up slowly. Defaults to 100. + """ + enforcingConsecutiveGatewayFailure: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through consecutive gateway failures. This setting can be + used to disable ejection or to ramp it up slowly. Defaults to 0. + """ + enforcingSuccessRate: Optional[float] = None + """ + The percentage chance that a host will be actually ejected when an outlier + status is detected through success rate statistics. This setting can be used to + disable ejection or to ramp it up slowly. Defaults to 100. + """ + interval: Optional[Interval] = None + """ + Time interval between ejection sweep analysis. This can result in both new + ejections as well as hosts being returned to service. Defaults to 10 seconds. + Structure is documented below. + """ + maxEjectionPercent: Optional[float] = None + """ + Maximum percentage of hosts in the load balancing pool for the backend service + that can be ejected. Defaults to 10%. + """ + successRateMinimumHosts: Optional[float] = None + """ + The number of hosts in a cluster that must have enough request volume to detect + success rate outliers. If the number of hosts is less than this setting, outlier + detection via success rate statistics is not performed for any host in the + cluster. Defaults to 5. + """ + successRateRequestVolume: Optional[float] = None + """ + The minimum number of total requests that must be collected in one interval (as + defined by the interval duration above) to include this host in success rate + based outlier detection. If the volume is lower than this setting, outlier + detection via success rate statistics is not performed for that host. Defaults + to 100. + """ + successRateStdevFactor: Optional[float] = None + """ + This factor is used to determine the ejection threshold for success rate outlier + ejection. The ejection threshold is the difference between the mean success + rate, and the product of this factor and the standard deviation of the mean + success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided + by a thousand to get a double. That is, if the desired factor is 1.9, the + runtime value should be 1900. Defaults to 1900. + """ + + +class StrongSessionAffinityCookie(BaseModel): + name: Optional[str] = None + """ + Name of the cookie. + """ + path: Optional[str] = None + """ + Path to set for the cookie. + """ + ttl: Optional[Ttl] = None + """ + Lifetime of the cookie. + Structure is documented below. + """ + + +class ForProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + customMetrics: Optional[List[CustomMetricModel]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[FailoverPolicy] = None + """ + Policy for failovers. + Structure is documented below. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to RegionHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of RegionHealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + region: str + """ + The Region in which the created backend service should reside. + If it is not provided, the provider region is used. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class CustomMetricModel1(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class CustomMetricModel2(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class InitProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItem]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + customMetrics: Optional[List[CustomMetricModel2]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[FailoverPolicy] = None + """ + Policy for failovers. + Structure is documented below. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to RegionHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of RegionHealthCheck in compute to populate healthChecks. + """ + iap: Optional[Iap] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CustomMetricModel3(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + maxUtilization: Optional[float] = None + """ + Optional parameter to define a target utilization for the Custom Metrics + balancing mode. The valid range is [0.0, 1.0]. + """ + name: Optional[str] = None + """ + Name of the cookie. + """ + + +class BackendItemModel(BaseModel): + balancingMode: Optional[str] = None + """ + Specifies the balancing mode for this backend. + See the Backend Services Overview + for an explanation of load balancing modes. + Default value is UTILIZATION. + Possible values are: UTILIZATION, RATE, CONNECTION, CUSTOM_METRICS. + """ + capacityScaler: Optional[float] = None + """ + A multiplier applied to the group's maximum servicing capacity + (based on UTILIZATION, RATE or CONNECTION). + ~>NOTE: This field cannot be set for + INTERNAL region backend services (default loadBalancingScheme), + but is required for non-INTERNAL backend service. The total + capacity_scaler for all backends must be non-zero. + A setting of 0 means the group is completely drained, offering + 0% of its available Capacity. Valid range is [0.0,1.0]. + """ + customMetrics: Optional[List[CustomMetricModel3]] = None + """ + The set of custom metrics that are used for CUSTOM_METRICS BalancingMode. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + Provide this property when you create the resource. + """ + failover: Optional[bool] = None + """ + This field designates whether this is a failover backend. More + than one failover backend can be configured for a given RegionBackendService. + """ + group: Optional[str] = None + """ + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend services cannot mix Instance Group and + Network Endpoint Group backends. + When the load_balancing_scheme is INTERNAL, only instance groups + are supported. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. + """ + maxConnections: Optional[float] = None + """ + The max number of simultaneous connections for the group. Can + be used with either CONNECTION or UTILIZATION balancing modes. + Cannot be set for INTERNAL backend services. + For CONNECTION mode, either maxConnections or one + of maxConnectionsPerInstance or maxConnectionsPerEndpoint, + as appropriate for group type, must be set. + """ + maxConnectionsPerEndpoint: Optional[float] = None + """ + The max number of simultaneous connections that a single backend + network endpoint can handle. Cannot be set + for INTERNAL backend services. + This is used to calculate the capacity of the group. Can be + used in either CONNECTION or UTILIZATION balancing modes. For + CONNECTION mode, either maxConnections or + maxConnectionsPerEndpoint must be set. + """ + maxConnectionsPerInstance: Optional[float] = None + """ + The max number of simultaneous connections that a single + backend instance can handle. Cannot be set for INTERNAL backend + services. + This is used to calculate the capacity of the group. + Can be used in either CONNECTION or UTILIZATION balancing modes. + For CONNECTION mode, either maxConnections or + maxConnectionsPerInstance must be set. + """ + maxRate: Optional[float] = None + """ + The max requests per second (RPS) of the group. Cannot be set + for INTERNAL backend services. + Can be used with either RATE or UTILIZATION balancing modes, + but required if RATE mode. Either maxRate or one + of maxRatePerInstance or maxRatePerEndpoint, as appropriate for + group type, must be set. + """ + maxRatePerEndpoint: Optional[float] = None + """ + The max requests per second (RPS) that a single backend network + endpoint can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerEndpoint must be set. Cannot be set + for INTERNAL backend services. + """ + maxRatePerInstance: Optional[float] = None + """ + The max requests per second (RPS) that a single backend + instance can handle. This is used to calculate the capacity of + the group. Can be used in either balancing mode. For RATE mode, + either maxRate or maxRatePerInstance must be set. Cannot be set + for INTERNAL backend services. + """ + maxUtilization: Optional[float] = None + """ + Used when balancingMode is UTILIZATION. This ratio defines the + CPU utilization target for the group. Valid range is [0.0, 1.0]. + Cannot be set for INTERNAL backend services. + """ + + +class CustomMetricModel4(BaseModel): + dryRun: Optional[bool] = None + """ + If true, the metric data is collected and reported to Cloud + Monitoring, but is not used for load balancing. + """ + name: Optional[str] = None + """ + Name of a custom utilization signal. The name must be 1-64 characters + long and match the regular expression a-z? which + means the first character must be a lowercase letter, and all following + characters must be a dash, period, underscore, lowercase letter, or + digit, except the last character, which cannot be a dash, period, or + underscore. For usage guidelines, see Custom Metrics balancing mode. This + field can only be used for a global or regional backend service with the + loadBalancingScheme set to EXTERNAL_MANAGED, + INTERNAL_MANAGED INTERNAL_SELF_MANAGED. + """ + + +class IapModel(BaseModel): + enabled: Optional[bool] = None + """ + Whether the serving infrastructure will authenticate and authorize all incoming requests. + """ + oauth2ClientId: Optional[str] = None + """ + OAuth2 Client ID for IAP + """ + + +class AtProvider(BaseModel): + affinityCookieTtlSec: Optional[float] = None + """ + Lifetime of cookies in seconds if session_affinity is + GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts + only until the end of the browser session (or equivalent). The + maximum allowed value for TTL is one day. + When the load balancing scheme is INTERNAL, this field is not used. + """ + backend: Optional[List[BackendItemModel]] = None + """ + The set of backends that serve this RegionBackendService. + Structure is documented below. + """ + cdnPolicy: Optional[CdnPolicy] = None + """ + Cloud CDN configuration for this BackendService. + Structure is documented below. + """ + circuitBreakers: Optional[CircuitBreakers] = None + """ + Settings controlling the volume of connections to a backend service. This field + is applicable only when the load_balancing_scheme is set to INTERNAL_MANAGED + and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + connectionDrainingTimeoutSec: Optional[float] = None + """ + Time for which instance will be drained (not accept new + connections, but still work to finish started). + """ + consistentHash: Optional[ConsistentHash] = None + """ + Consistent Hash-based load balancing can be used to provide soft session + affinity based on HTTP headers, cookies or other properties. This load balancing + policy is applicable only for HTTP connections. The affinity to a particular + destination host will be lost when one or more hosts are added/removed from the + destination service. This field specifies parameters that control consistent + hashing. + This field only applies when all of the following are true - + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customMetrics: Optional[List[CustomMetricModel4]] = None + """ + List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enableCdn: Optional[bool] = None + """ + If true, enable Cloud CDN for this RegionBackendService. + """ + failoverPolicy: Optional[FailoverPolicy] = None + """ + Policy for failovers. + Structure is documented below. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + generatedId: Optional[float] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + healthChecks: Optional[List[str]] = None + """ + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + """ + iap: Optional[IapModel] = None + """ + Settings for enabling Cloud Identity Aware Proxy. + If OAuth client is not set, Google-managed OAuth client is used. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/backendServices/{{name}} + """ + ipAddressSelectionPolicy: Optional[str] = None + """ + Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). + Possible values are: IPV4_ONLY, PREFER_IPV6, IPV6_ONLY. + """ + loadBalancingScheme: Optional[str] = None + """ + is set to INTERNAL_MANAGED + """ + localityLbPolicy: Optional[str] = None + """ + is set to MAGLEV or RING_HASH + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the logging options for the load balancer traffic served by this backend service. + If logging is enabled, logs will be exported to Stackdriver. + Structure is documented below. + """ + network: Optional[str] = None + """ + The URL of the network to which this backend service belongs. + This field can only be specified when the load balancing scheme is set to INTERNAL. + """ + outlierDetection: Optional[OutlierDetection] = None + """ + Settings controlling eviction of unhealthy hosts from the load balancing pool. + This field is applicable only when the load_balancing_scheme is set + to INTERNAL_MANAGED and the protocol is set to HTTP, HTTPS, HTTP2 or H2C. + Structure is documented below. + """ + portName: Optional[str] = None + """ + A named port on a backend instance group representing the port for + communication to the backend VMs in that group. Required when the + loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED + and the backends are instance groups. The named port must be defined on each + backend instance group. This parameter has no meaning if the backends are NEGs. API sets a + default of "http" if not given. + Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + protocol: Optional[str] = None + """ + is set to HTTP, HTTPS, HTTP2 or H2C + """ + region: Optional[str] = None + """ + The Region in which the created backend service should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sessionAffinity: Optional[str] = None + """ + Type of session affinity to use. The default is NONE. Session affinity is + not applicable if the protocol is UDP. + Possible values are: NONE, CLIENT_IP, CLIENT_IP_PORT_PROTO, CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, CLIENT_IP_NO_DESTINATION, STRONG_COOKIE_AFFINITY. + """ + strongSessionAffinityCookie: Optional[StrongSessionAffinityCookie] = None + """ + Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + The backend service timeout has a different meaning depending on the type of load balancer. + For more information see, Backend service settings. + The default is 30 seconds. + The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionBackendService(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionBackendService']] = 'RegionBackendService' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionBackendServiceSpec defines the desired state of RegionBackendService + """ + status: Optional[Status] = None + """ + RegionBackendServiceStatus defines the observed state of RegionBackendService. + """ + + +class RegionBackendServiceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionBackendService] + """ + List of regionbackendservices. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiondisk/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regiondisk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiondisk/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regiondisk/v1beta1.py new file mode 100644 index 000000000..2119e2e33 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regiondisk/v1beta1.py @@ -0,0 +1,782 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regiondisk.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AsyncPrimaryDisk(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a RegionDisk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a RegionDisk in compute to populate disk. + """ + + +class RawKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class DiskEncryptionKey(BaseModel): + kmsKeyName: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + customer-supplied encryption key to either encrypt or decrypt + this resource. You can provide either the rawKey or the rsaEncryptedKey. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class GuestOsFeature(BaseModel): + type: Optional[str] = None + """ + The type of supported feature. Read Enabling guest operating system features to see a list of available options. + Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE. + """ + + +class SnapshotRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SnapshotSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceSnapshotEncryptionKey(BaseModel): + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + + +class ForProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + region: str + """ + A reference to the region where the disk resides. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + snapshotRef: Optional[SnapshotRef] = None + """ + Reference to a Snapshot in compute to populate snapshot. + """ + snapshotSelector: Optional[SnapshotSelector] = None + """ + Selector for a Snapshot in compute to populate snapshot. + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class InitProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDisk] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKey] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + snapshotRef: Optional[SnapshotRef] = None + """ + Reference to a Snapshot in compute to populate snapshot. + """ + snapshotSelector: Optional[SnapshotSelector] = None + """ + Selector for a Snapshot in compute to populate snapshot. + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsyncPrimaryDiskModel(BaseModel): + disk: Optional[str] = None + """ + Primary disk for asynchronous disk replication. + """ + + +class DiskEncryptionKeyModel(BaseModel): + kmsKeyName: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceSnapshotEncryptionKeyModel(BaseModel): + rawKey: Optional[str] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class AtProvider(BaseModel): + accessMode: Optional[str] = None + """ + The access mode of the disk. + For example: + """ + asyncPrimaryDisk: Optional[AsyncPrimaryDiskModel] = None + """ + A nested object resource. + Structure is documented below. + """ + createSnapshotBeforeDestroy: Optional[bool] = None + """ + If set to true, a snapshot of the disk will be created before it is destroyed. + If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. + The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm + """ + createSnapshotBeforeDestroyPrefix: Optional[str] = None + """ + This will set a custom name prefix for the snapshot that's created when the disk is deleted. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + diskEncryptionKey: Optional[DiskEncryptionKeyModel] = None + """ + Encrypts the disk using a customer-supplied encryption key. + After you encrypt a disk with a customer-supplied key, you must + provide the same key if you use the disk later (e.g. to create a disk + snapshot or an image, or to attach the disk to a virtual machine). + Customer-supplied encryption keys do not protect access to metadata of + the disk. + If you do not provide an encryption key when creating the disk, then + the disk will be encrypted using an automatically generated key and + you do not need to provide a key to use the disk later. + Structure is documented below. + """ + diskId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + effectiveLabels: Optional[Dict[str, str]] = None + """ + for all of the labels present on the resource. + """ + guestOsFeatures: Optional[List[GuestOsFeature]] = None + """ + A list of features to enable on the guest operating system. + Applicable only for bootable disks. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/disks/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this disk. A list of key->value pairs. + """ + lastAttachTimestamp: Optional[str] = None + """ + Last attach timestamp in RFC3339 text format. + """ + lastDetachTimestamp: Optional[str] = None + """ + Last detach timestamp in RFC3339 text format. + """ + licenses: Optional[List[str]] = None + """ + Any applicable license URI. + """ + physicalBlockSizeBytes: Optional[float] = None + """ + Physical block size of the persistent disk, in bytes. If not present + in a request, a default value is used. Currently supported sizes + are 4096 and 16384, other sizes may be added in the future. + If an unsupported value is requested, the error message will list + the supported values for the caller's project. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + provisionedIops: Optional[float] = None + """ + Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second + that the disk can handle. Values must be between 10,000 and 120,000. + For more details, see the Extreme persistent disk documentation. + """ + provisionedThroughput: Optional[float] = None + """ + Indicates how much throughput to provision for the disk. This sets the number of throughput + mb per second that the disk can handle. Values must be greater than or equal to 1. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + replicaZones: Optional[List[str]] = None + """ + URLs of the zones where the disk should be replicated to. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + size: Optional[float] = None + """ + Size of the persistent disk, specified in GB. You can specify this + field when creating a persistent disk using the sourceImage or + sourceSnapshot parameter, or specify it alone to create an empty + persistent disk. + If you specify this field along with sourceImage or sourceSnapshot, + the value of sizeGb must not be less than the size of the sourceImage + or the size of the snapshot. + """ + snapshot: Optional[str] = None + """ + The source snapshot used to create this disk. You can provide this as + a partial or full URL to the resource. For example, the following are + valid values: + """ + sourceDisk: Optional[str] = None + """ + The source disk used to create this disk. You can provide this as a partial or full URL to the resource. + For example, the following are valid values: + """ + sourceDiskId: Optional[str] = None + """ + The ID value of the disk used to create this image. This value may + be used to determine whether the image was taken from the current + or a previous instance of a given disk name. + """ + sourceSnapshotEncryptionKey: Optional[SourceSnapshotEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceSnapshotId: Optional[str] = None + """ + The unique ID of the snapshot used to create this disk. This value + identifies the exact snapshot that was used to create this persistent + disk. For example, if you created the persistent disk from a snapshot + that was later deleted and recreated under the same name, the source + snapshot ID would identify the exact version of the snapshot that was + used. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + type: Optional[str] = None + """ + URL of the disk type resource describing which disk type to use to + create the disk. Provide this when creating the disk. + """ + users: Optional[List[str]] = None + """ + Links to the users of the disk (attached instances) in form: + project/zones/zone/instances/instance + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDisk(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionDisk']] = 'RegionDisk' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskSpec defines the desired state of RegionDisk + """ + status: Optional[Status] = None + """ + RegionDiskStatus defines the observed state of RegionDisk. + """ + + +class RegionDiskList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDisk] + """ + List of regiondisks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiondiskiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regiondiskiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiondiskiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regiondiskiammember/v1beta1.py new file mode 100644 index 000000000..ffee54244 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regiondiskiammember/v1beta1.py @@ -0,0 +1,267 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regiondiskiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a RegionDisk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a RegionDisk in compute to populate name. + """ + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + nameRef: Optional[NameRef] = None + """ + Reference to a RegionDisk in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a RegionDisk in compute to populate name. + """ + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDiskIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionDiskIAMMember']] = 'RegionDiskIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskIAMMemberSpec defines the desired state of RegionDiskIAMMember + """ + status: Optional[Status] = None + """ + RegionDiskIAMMemberStatus defines the observed state of RegionDiskIAMMember. + """ + + +class RegionDiskIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDiskIAMMember] + """ + List of regiondiskiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiondiskresourcepolicyattachment/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regiondiskresourcepolicyattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py new file mode 100644 index 000000000..dfb515ab3 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regiondiskresourcepolicyattachment/v1beta1.py @@ -0,0 +1,352 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regiondiskresourcepolicyattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class DiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the regional disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a RegionDisk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a RegionDisk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + + +class InitProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the regional disk in which the resource policies are attached to. + """ + diskRef: Optional[DiskRef] = None + """ + Reference to a RegionDisk in compute to populate disk. + """ + diskSelector: Optional[DiskSelector] = None + """ + Selector for a RegionDisk in compute to populate disk. + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + nameRef: Optional[NameRef] = None + """ + Reference to a ResourcePolicy in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a ResourcePolicy in compute to populate name. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + disk: Optional[str] = None + """ + The name of the regional disk in which the resource policies are attached to. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{disk}}/{{name}} + """ + name: Optional[str] = None + """ + The resource policy to be attached to the disk for scheduling snapshot + creation. Do not specify the self link. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + A reference to the region where the disk resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionDiskResourcePolicyAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionDiskResourcePolicyAttachment']] = ( + 'RegionDiskResourcePolicyAttachment' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionDiskResourcePolicyAttachmentSpec defines the desired state of RegionDiskResourcePolicyAttachment + """ + status: Optional[Status] = None + """ + RegionDiskResourcePolicyAttachmentStatus defines the observed state of RegionDiskResourcePolicyAttachment. + """ + + +class RegionDiskResourcePolicyAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionDiskResourcePolicyAttachment] + """ + List of regiondiskresourcepolicyattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionhealthcheck/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionhealthcheck/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionhealthcheck/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionhealthcheck/v1beta1.py new file mode 100644 index 000000000..30eca5050 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionhealthcheck/v1beta1.py @@ -0,0 +1,635 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionhealthcheck.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class GrpcHealthCheck(BaseModel): + grpcServiceName: Optional[str] = None + """ + The gRPC service name for the health check. + The value of grpcServiceName has the following meanings by convention: + """ + port: Optional[float] = None + """ + The port number for the health check request. + Must be specified if portName and portSpecification are not set + or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + + +class Http2HealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP2 health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP2 health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP2 health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTP health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTP health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class HttpsHealthCheck(BaseModel): + host: Optional[str] = None + """ + The value of the host header in the HTTPS health check request. + If left empty (default value), the public IP on behalf of which this health + check is performed will be used. + """ + port: Optional[float] = None + """ + The TCP port number for the HTTPS health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + requestPath: Optional[str] = None + """ + The request path of the HTTPS health check request. + The default value is /. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. This is false by default, + which means no health check logging will be done. + """ + + +class SslHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the SSL health check request. + The default value is 443. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the SSL connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class TcpHealthCheck(BaseModel): + port: Optional[float] = None + """ + The TCP port number for the TCP health check request. + The default value is 80. + """ + portName: Optional[str] = None + """ + Port name as defined in InstanceGroup#NamedPort#name. If both port and + port_name are defined, port takes precedence. + """ + portSpecification: Optional[str] = None + """ + Specifies how port is selected for health checking, can be one of the + following values: + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to the + backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + request: Optional[str] = None + """ + The application data to send once the TCP connection has been + established (default value is empty). If both request and response are + empty, the connection establishment alone will indicate health. The request + data can only be ASCII. + """ + response: Optional[str] = None + """ + The bytes to match against the beginning of the response data. If left empty + (the default value), any response will indicate health. The response data + can only be ASCII. + """ + + +class ForProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created health check should reside. + If it is not provided, the provider region is used. + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class InitProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + checkIntervalSec: Optional[float] = None + """ + How often (in seconds) to send a health check. The default value is 5 + seconds. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + grpcHealthCheck: Optional[GrpcHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + healthCheckId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + healthyThreshold: Optional[float] = None + """ + A so-far unhealthy instance will be marked healthy after this many + consecutive successes. The default value is 2. + """ + http2HealthCheck: Optional[Http2HealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpHealthCheck: Optional[HttpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + httpsHealthCheck: Optional[HttpsHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/healthChecks/{{name}} + """ + logConfig: Optional[LogConfig] = None + """ + Configure logging on this health check. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created health check should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sslHealthCheck: Optional[SslHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + tcpHealthCheck: Optional[TcpHealthCheck] = None + """ + A nested object resource. + Structure is documented below. + """ + timeoutSec: Optional[float] = None + """ + How long (in seconds) to wait before claiming failure. + The default value is 5 seconds. It is invalid for timeoutSec to have + greater value than checkIntervalSec. + """ + type: Optional[str] = None + """ + The type of the health check. One of HTTP, HTTP2, HTTPS, TCP, or SSL. + """ + unhealthyThreshold: Optional[float] = None + """ + A so-far healthy instance will be marked unhealthy after this many + consecutive failures. The default value is 2. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionHealthCheck(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionHealthCheck']] = 'RegionHealthCheck' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionHealthCheckSpec defines the desired state of RegionHealthCheck + """ + status: Optional[Status] = None + """ + RegionHealthCheckStatus defines the observed state of RegionHealthCheck. + """ + + +class RegionHealthCheckList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionHealthCheck] + """ + List of regionhealthchecks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regioninstancegroupmanager/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regioninstancegroupmanager/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regioninstancegroupmanager/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regioninstancegroupmanager/v1beta1.py new file mode 100644 index 000000000..d6cf18440 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regioninstancegroupmanager/v1beta1.py @@ -0,0 +1,993 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regioninstancegroupmanager.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AllInstancesConfig(BaseModel): + labels: Optional[Dict[str, str]] = None + """ + , The label key-value pairs that you want to patch onto the instance. + """ + metadata: Optional[Dict[str, str]] = None + """ + , The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthCheckRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthCheckSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AutoHealingPolicies(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + healthCheckRef: Optional[HealthCheckRef] = None + """ + Reference to a HealthCheck in compute to populate healthCheck. + """ + healthCheckSelector: Optional[HealthCheckSelector] = None + """ + Selector for a HealthCheck in compute to populate healthCheck. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class InstanceSelection(BaseModel): + machineTypes: Optional[List[str]] = None + """ + , A list of full machine-type names, e.g. "n1-standard-16". + """ + name: Optional[str] = None + """ + , Name of the instance selection, e.g. instance_selection_with_n1_machines_types. Instance selection names must be unique within the flexibility policy. + """ + rank: Optional[float] = None + """ + , Preference of this instance selection. Lower number means higher preference. Managed instance group will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference. + """ + + +class InstanceFlexibilityPolicy(BaseModel): + instanceSelections: Optional[List[InstanceSelection]] = None + """ + , Named instance selections configuring properties that the group will use when creating new VMs. One can specify multiple instance selection to allow managed instance group to create VMs from multiple types of machines, based on preference and availability. Structure is documented below. + """ + + +class InstanceLifecyclePolicy(BaseModel): + defaultActionOnFailure: Optional[str] = None + """ + , Specifies the action that a MIG performs on a failed VM. If the value of the on_failed_health_check field is DEFAULT_ACTION, then the same action also applies to the VMs on which your application fails a health check. Valid options are: DO_NOTHING, REPAIR. If DO_NOTHING, then MIG does not repair a failed VM. If REPAIR (default), then MIG automatically repairs a failed VM by recreating it. For more information, see about repairing VMs in a MIG. + """ + forceUpdateOnRepair: Optional[str] = None + """ + , Specifies whether to apply the group's latest configuration when repairing a VM. Valid options are: YES, NO. If YES and you updated the group's instance template or per-instance configurations after the VM was created, then these changes are applied when VM is repaired. If NO (default), then updates are applied in accordance with the group's update policy type. + """ + + +class NamedPortItem(BaseModel): + name: Optional[str] = None + """ + The name of the port. + """ + port: Optional[float] = None + """ + The port number. + """ + + +class StandbyPolicy(BaseModel): + initialDelaySec: Optional[float] = None + """ + - Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + """ + mode: Optional[str] = None + """ + - Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. Valid options are: MANUAL, SCALE_OUT_POOL. If MANUAL(default), you have full control over which VMs are stopped and suspended in the MIG. If SCALE_OUT_POOL, the MIG uses the VMs from the standby pools to accelerate the scale out by resuming or starting them and then automatically replenishes the standby pool with new VMs to maintain the target sizes. + """ + + +class StatefulDiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the stateful disk when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the disk when the VM is deleted, but do not delete the disk. ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently deleted from the instance group. The default is NEVER. + """ + deviceName: Optional[str] = None + """ + , The device name of the disk to be attached. + """ + + +class StatefulExternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the external ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the external ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the external Ip. Possible value: nic0. + """ + + +class StatefulInternalIpItem(BaseModel): + deleteRule: Optional[str] = None + """ + , A value that prescribes what should happen to the internal ip when the VM instance is deleted. The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. NEVER - detach the ip when the VM is deleted, but do not delete the ip. ON_PERMANENT_INSTANCE_DELETION will delete the internal ip when the VM is permanently deleted from the instance group. + """ + interfaceName: Optional[str] = None + """ + , The network interface name of the internal Ip. Possible value: nic0. + """ + + +class TargetPoolsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetPoolsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UpdatePolicy(BaseModel): + instanceRedistributionType: Optional[str] = None + """ + - The instance redistribution policy for regional managed instance groups. Valid values are: "PROACTIVE", "NONE". If PROACTIVE (default), the group attempts to maintain an even distribution of VM instances across zones in the region. If NONE, proactive redistribution is disabled. + """ + maxSurgeFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. Conflicts with max_surge_percent. Both cannot be 0. + """ + maxSurgePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. Conflicts with max_surge_fixed. + """ + maxUnavailableFixed: Optional[float] = None + """ + , Specifies a fixed number of VM instances. This must be a positive integer. + """ + maxUnavailablePercent: Optional[float] = None + """ + , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.. + """ + minimalAction: Optional[str] = None + """ + - Minimal action to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + """ + replacementMethod: Optional[str] = None + """ + , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved. You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0. + """ + type: Optional[str] = None + """ + - The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + """ + + +class InstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetSize(BaseModel): + fixed: Optional[float] = None + """ + , The number of instances which are managed for this version. Conflicts with percent. + """ + percent: Optional[float] = None + """ + , The number of instances (calculated as percentage) which are managed for this version. Conflicts with fixed. + Note that when using percent, rounding will be in favor of explicitly set target_size values; a managed instance group with 2 instances and 2 versions, + one of which has a target_size.percent of 60 will create 2 instances of that version. + """ + + +class VersionItem(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. + """ + instanceTemplateRef: Optional[InstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate instanceTemplate. + """ + instanceTemplateSelector: Optional[InstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate instanceTemplate. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class ForProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + instanceFlexibilityPolicy: Optional[InstanceFlexibilityPolicy] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class InitProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPolicies] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + instanceFlexibilityPolicy: Optional[InstanceFlexibilityPolicy] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetPoolsRefs: Optional[List[TargetPoolsRef]] = None + """ + References to TargetPool in compute to populate targetPools. + """ + targetPoolsSelector: Optional[TargetPoolsSelector] = None + """ + Selector for a list of TargetPool in compute to populate targetPools. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItem]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AutoHealingPoliciesModel(BaseModel): + healthCheck: Optional[str] = None + """ + The health check resource that signals autohealing. + """ + initialDelaySec: Optional[float] = None + """ + The number of seconds that the managed instance group waits before + it applies autohealing policies to new instances or recently recreated instances. Between 0 and 3600. + """ + + +class AllInstancesConfigItem(BaseModel): + currentRevision: Optional[str] = None + """ + Current all-instances configuration revision. This value is in RFC3339 text format. + """ + effective: Optional[bool] = None + """ + A bit indicating whether this configuration has been applied to all managed instances in the group. + """ + + +class PerInstanceConfig(BaseModel): + allEffective: Optional[bool] = None + """ + A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + """ + + +class StatefulItem(BaseModel): + hasStatefulConfig: Optional[bool] = None + """ + A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + """ + perInstanceConfigs: Optional[List[PerInstanceConfig]] = None + """ + Status of per-instance configs on the instances. + """ + + +class VersionTargetItem(BaseModel): + isReached: Optional[bool] = None + + +class StatusItem(BaseModel): + allInstancesConfig: Optional[List[AllInstancesConfigItem]] = None + """ + Status of all-instances configuration on the group. + """ + isStable: Optional[bool] = None + """ + A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + """ + stateful: Optional[List[StatefulItem]] = None + """ + Stateful status of the given Instance Group Manager. + """ + versionTarget: Optional[List[VersionTargetItem]] = None + """ + A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + """ + + +class VersionItemModel(BaseModel): + instanceTemplate: Optional[str] = None + """ + - The full URL to an instance template from which all new instances of this version will be created. + """ + name: Optional[str] = None + """ + - Version name. + """ + targetSize: Optional[TargetSize] = None + """ + - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below. + """ + + +class AtProvider(BaseModel): + allInstancesConfig: Optional[AllInstancesConfig] = None + """ + Properties to set on all instances in the group. After setting + allInstancesConfig on the group, you must update the group's instances to + apply the configuration. + """ + autoHealingPolicies: Optional[AutoHealingPoliciesModel] = None + """ + The autohealing policies for this managed instance + group. You can specify only one value. Structure is documented below. For more information, see the official documentation. + """ + baseInstanceName: Optional[str] = None + """ + The base instance name to use for + instances in this group. The value must be a valid + RFC1035 name. Supported characters + are lowercase letters, numbers, and hyphens (-). Instances are named by + appending a hyphen and a random four-character string to the base instance + name. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional textual description of the instance + group manager. + """ + distributionPolicyTargetShape: Optional[str] = None + """ + The shape to which the group converges either proactively or on resize events (depending on the value set in update_policy.0.instance_redistribution_type). For more information see the official documentation. + """ + distributionPolicyZones: Optional[List[str]] = None + """ + The distribution policy for this managed instance + group. You can specify one or more values. For more information, see the official documentation. + """ + fingerprint: Optional[str] = None + """ + The fingerprint of the instance group manager. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{name}} + """ + instanceFlexibilityPolicy: Optional[InstanceFlexibilityPolicy] = None + """ + The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is documented below. + """ + instanceGroup: Optional[str] = None + """ + The full URL of the instance group created by the manager. + """ + instanceGroupManagerId: Optional[float] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{name}} + """ + instanceLifecyclePolicy: Optional[InstanceLifecyclePolicy] = None + listManagedInstancesResults: Optional[str] = None + """ + Pagination behavior of the listManagedInstances API + method for this managed instance group. Valid values are: PAGELESS, PAGINATED. + If PAGELESS (default), Pagination is disabled for the group's listManagedInstances API method. + maxResults and pageToken query parameters are ignored and all instances are returned in a single + response. If PAGINATED, pagination is enabled, maxResults and pageToken query parameters are + respected. + """ + name: Optional[str] = None + """ + The name of the instance group manager. Must be 1-63 + characters long and comply with + RFC1035. Supported characters + include lowercase letters, numbers, and hyphens. + """ + namedPort: Optional[List[NamedPortItem]] = None + """ + The named port configuration. See the section below + for details on configuration. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the managed instance group resides. If not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URL of the created resource. + """ + standbyPolicy: Optional[StandbyPolicy] = None + """ + The standby policy for stopped and suspended instances. Structure is documented below. For more information, see the official documentation. + """ + statefulDisk: Optional[List[StatefulDiskItem]] = None + """ + Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the official documentation. Proactive cross zone instance redistribution must be disabled before you can update stateful disks on existing instance group managers. This can be controlled via the update_policy. + """ + statefulExternalIp: Optional[List[StatefulExternalIpItem]] = None + """ + External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + statefulInternalIp: Optional[List[StatefulInternalIpItem]] = None + """ + Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. Structure is documented below. + """ + status: Optional[List[StatusItem]] = None + targetPools: Optional[List[str]] = None + """ + The full URL of all target pools to which new + instances in the group are added. Updating the target pools attribute does + not affect existing instances. + """ + targetSize: Optional[float] = None + """ + The target number of running instances for this managed + instance group. This value will fight with autoscaler settings when set, and generally shouldn't be set + when using one. If a value is required, such as to specify a creation-time target size for the MIG, + lifecycle. Defaults to 0. + """ + targetStoppedSize: Optional[float] = None + """ + The target number of stopped instances for this managed instance group. + """ + targetSuspendedSize: Optional[float] = None + """ + The target number of suspended instances for this managed instance group. + """ + updatePolicy: Optional[UpdatePolicy] = None + """ + The update policy for this managed instance group. Structure is documented below. For more information, see the official documentation and API + """ + version: Optional[List[VersionItemModel]] = None + """ + Application versions managed by this instance group. Each + version deals with a specific instance template, allowing canary release scenarios. + Structure is documented below. + """ + waitForInstances: Optional[bool] = None + """ + Whether to wait for all instances to be created/updated before + returning. + """ + waitForInstancesStatus: Optional[str] = None + """ + When used with wait_for_instances it specifies the status to wait for. + When STABLE is specified this resource will wait until the instances are stable before returning. When UPDATED is + set, it will wait for the version target to be reached and any per instance configs to be effective as well as all + instances to be stable before returning. The possible values are STABLE and UPDATED + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionInstanceGroupManager(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionInstanceGroupManager']] = 'RegionInstanceGroupManager' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionInstanceGroupManagerSpec defines the desired state of RegionInstanceGroupManager + """ + status: Optional[Status] = None + """ + RegionInstanceGroupManagerStatus defines the observed state of RegionInstanceGroupManager. + """ + + +class RegionInstanceGroupManagerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionInstanceGroupManager] + """ + List of regioninstancegroupmanagers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpoint/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpoint/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpoint/v1beta1.py new file mode 100644 index 000000000..59064f0ef --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpoint/v1beta1.py @@ -0,0 +1,334 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionnetworkendpoint.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class RegionNetworkEndpointGroupRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionNetworkEndpointGroupSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing network endpoint group is located. + """ + regionNetworkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + regionNetworkEndpointGroupRef: Optional[RegionNetworkEndpointGroupRef] = None + """ + Reference to a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + regionNetworkEndpointGroupSelector: Optional[RegionNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + + +class InitProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing network endpoint group is located. + """ + regionNetworkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + regionNetworkEndpointGroupRef: Optional[RegionNetworkEndpointGroupRef] = None + """ + Reference to a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + regionNetworkEndpointGroupSelector: Optional[RegionNetworkEndpointGroupSelector] = ( + None + ) + """ + Selector for a RegionNetworkEndpointGroup in compute to populate regionNetworkEndpointGroup. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + fqdn: Optional[str] = None + """ + Fully qualified domain name of network endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} + """ + ipAddress: Optional[str] = None + """ + IPv4 address external endpoint. + This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT. + """ + networkEndpointId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + port: Optional[float] = None + """ + Port number of network endpoint. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing network endpoint group is located. + """ + regionNetworkEndpointGroup: Optional[str] = None + """ + The network endpoint group this endpoint is part of. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkEndpoint(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkEndpoint']] = 'RegionNetworkEndpoint' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkEndpointSpec defines the desired state of RegionNetworkEndpoint + """ + status: Optional[Status] = None + """ + RegionNetworkEndpointStatus defines the observed state of RegionNetworkEndpoint. + """ + + +class RegionNetworkEndpointList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkEndpoint] + """ + List of regionnetworkendpoints. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpointgroup/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpointgroup/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpointgroup/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpointgroup/v1beta1.py new file mode 100644 index 000000000..f4f7154d6 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkendpointgroup/v1beta1.py @@ -0,0 +1,736 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionnetworkendpointgroup.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AppEngine(BaseModel): + service: Optional[str] = None + """ + Optional serving service. + The service name must be 1-63 characters long, and comply with RFC1035. + Example value: "default", "my-service". + """ + urlMask: Optional[str] = None + """ + A template to parse service and version fields from a request URL. + URL mask allows for routing to multiple App Engine services without + having to create multiple Network Endpoint Groups and backend services. + For example, the request URLs "foo1-dot-appname.appspot.com/v1" and + "foo1-dot-appname.appspot.com/v2" can be backed by the same Serverless NEG with + URL mask "-dot-appname.appspot.com/". The URL mask will parse + them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + """ + version: Optional[str] = None + """ + Optional serving version. + The version must be 1-63 characters long, and comply with RFC1035. + Example value: "v1", "v2". + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class FunctionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FunctionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CloudFunction(BaseModel): + function: Optional[str] = None + """ + A user-defined name of the Cloud Function. + The function name is case-sensitive and must be 1-63 characters long. + Example value: "func1". + """ + functionRef: Optional[FunctionRef] = None + """ + Reference to a Function in cloudfunctions to populate function. + """ + functionSelector: Optional[FunctionSelector] = None + """ + Selector for a Function in cloudfunctions to populate function. + """ + urlMask: Optional[str] = None + """ + A template to parse function field from a request URL. URL mask allows + for routing to multiple Cloud Functions without having to create + multiple Network Endpoint Groups and backend services. + For example, request URLs "mydomain.com/function1" and "mydomain.com/function2" + can be backed by the same Serverless NEG with URL mask "/". The URL mask + will parse them to { function = "function1" } and { function = "function2" } respectively. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class CloudRun(BaseModel): + service: Optional[str] = None + """ + Cloud Run service is the main resource of Cloud Run. + The service must be 1-63 characters long, and comply with RFC1035. + Example value: "run-service". + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a Service in cloudrun to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a Service in cloudrun to populate service. + """ + tag: Optional[str] = None + """ + Cloud Run tag represents the "named-revision" to provide + additional fine-grained traffic routing information. + The tag must be 1-63 characters long, and comply with RFC1035. + Example value: "revision-0010". + """ + urlMask: Optional[str] = None + """ + A template to parse service and tag fields from a request URL. + URL mask allows for routing to multiple Run services without having + to create multiple network endpoint groups and backend services. + For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" + an be backed by the same Serverless Network Endpoint Group (NEG) with + URL mask ".domain.com/". The URL mask will parse them to { service="bar1", tag="foo1" } + and { service="bar2", tag="foo2" } respectively. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PscData(BaseModel): + producerPort: Optional[str] = None + """ + The PSC producer port to use when consumer PSC NEG connects to a producer. If + this flag isn't specified for a PSC NEG with endpoint type + private-service-connect, then PSC NEG will be connected to a first port in the + available PSC producer port range. + """ + + +class PscTargetServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PscTargetServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + appEngine: Optional[AppEngine] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[CloudFunction] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[CloudRun] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, GCE_VM_IP_PORTMAP. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[PscData] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + pscTargetServiceRef: Optional[PscTargetServiceRef] = None + """ + Reference to a ServiceAttachment in compute to populate pscTargetService. + """ + pscTargetServiceSelector: Optional[PscTargetServiceSelector] = None + """ + Selector for a ServiceAttachment in compute to populate pscTargetService. + """ + region: str + """ + A reference to the region where the regional NEGs reside. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + appEngine: Optional[AppEngine] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[CloudFunction] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[CloudRun] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, GCE_VM_IP_PORTMAP. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[PscData] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + pscTargetServiceRef: Optional[PscTargetServiceRef] = None + """ + Reference to a ServiceAttachment in compute to populate pscTargetService. + """ + pscTargetServiceSelector: Optional[PscTargetServiceSelector] = None + """ + Selector for a ServiceAttachment in compute to populate pscTargetService. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class CloudFunctionModel(BaseModel): + function: Optional[str] = None + """ + A user-defined name of the Cloud Function. + The function name is case-sensitive and must be 1-63 characters long. + Example value: "func1". + """ + urlMask: Optional[str] = None + """ + A template to parse function field from a request URL. URL mask allows + for routing to multiple Cloud Functions without having to create + multiple Network Endpoint Groups and backend services. + For example, request URLs "mydomain.com/function1" and "mydomain.com/function2" + can be backed by the same Serverless NEG with URL mask "/". The URL mask + will parse them to { function = "function1" } and { function = "function2" } respectively. + """ + + +class CloudRunModel(BaseModel): + service: Optional[str] = None + """ + Cloud Run service is the main resource of Cloud Run. + The service must be 1-63 characters long, and comply with RFC1035. + Example value: "run-service". + """ + tag: Optional[str] = None + """ + Cloud Run tag represents the "named-revision" to provide + additional fine-grained traffic routing information. + The tag must be 1-63 characters long, and comply with RFC1035. + Example value: "revision-0010". + """ + urlMask: Optional[str] = None + """ + A template to parse service and tag fields from a request URL. + URL mask allows for routing to multiple Run services without having + to create multiple network endpoint groups and backend services. + For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" + an be backed by the same Serverless Network Endpoint Group (NEG) with + URL mask ".domain.com/". The URL mask will parse them to { service="bar1", tag="foo1" } + and { service="bar2", tag="foo2" } respectively. + """ + + +class AtProvider(BaseModel): + appEngine: Optional[AppEngine] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudFunction: Optional[CloudFunctionModel] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + cloudRun: Optional[CloudRunModel] = None + """ + This field is only used for SERVERLESS NEGs. + Only one of cloud_run, app_engine, cloud_function or serverless_deployment may be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{name}} + """ + network: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The URL of the network to which all network endpoints in the NEG belong. Uses + "default" project network if unspecified. + """ + networkEndpointType: Optional[str] = None + """ + Type of network endpoints in this network endpoint group. Defaults to SERVERLESS. + Default value is SERVERLESS. + Possible values are: SERVERLESS, PRIVATE_SERVICE_CONNECT, INTERNET_IP_PORT, INTERNET_FQDN_PORT, GCE_VM_IP_PORTMAP. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + pscData: Optional[PscData] = None + """ + This field is only used for PSC NEGs. + Structure is documented below. + """ + pscTargetService: Optional[str] = None + """ + This field is only used for PSC and INTERNET NEGs. + The target service url used to set up private service connection to + a Google API or a PSC Producer Service Attachment. + """ + region: Optional[str] = None + """ + A reference to the region where the regional NEGs reside. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + subnetwork: Optional[str] = None + """ + This field is only used for PSC NEGs. + Optional URL of the subnetwork to which all network endpoints in the NEG belong. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkEndpointGroup(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkEndpointGroup']] = 'RegionNetworkEndpointGroup' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkEndpointGroupSpec defines the desired state of RegionNetworkEndpointGroup + """ + status: Optional[Status] = None + """ + RegionNetworkEndpointGroupStatus defines the observed state of RegionNetworkEndpointGroup. + """ + + +class RegionNetworkEndpointGroupList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkEndpointGroup] + """ + List of regionnetworkendpointgroups. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py new file mode 100644 index 000000000..28b70fa62 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicy/v1beta1.py @@ -0,0 +1,238 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionnetworkfirewallpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region of this resource. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of the resource. This field is used internally during updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/firewallPolicies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region of this resource. + """ + regionNetworkFirewallPolicyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + ruleTupleCount: Optional[float] = None + """ + Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkFirewallPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkFirewallPolicy']] = ( + 'RegionNetworkFirewallPolicy' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkFirewallPolicySpec defines the desired state of RegionNetworkFirewallPolicy + """ + status: Optional[Status] = None + """ + RegionNetworkFirewallPolicyStatus defines the observed state of RegionNetworkFirewallPolicy. + """ + + +class RegionNetworkFirewallPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkFirewallPolicy] + """ + List of regionnetworkfirewallpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicyassociation/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicyassociation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py new file mode 100644 index 000000000..35780b5bc --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionnetworkfirewallpolicyassociation/v1beta1.py @@ -0,0 +1,337 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionnetworkfirewallpolicyassociation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class AttachmentTargetRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class AttachmentTargetSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class FirewallPolicyRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class FirewallPolicySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + firewallPolicyRef: Optional[FirewallPolicyRef] = None + """ + Reference to a RegionNetworkFirewallPolicy in compute to populate firewallPolicy. + """ + firewallPolicySelector: Optional[FirewallPolicySelector] = None + """ + Selector for a RegionNetworkFirewallPolicy in compute to populate firewallPolicy. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The location of this resource. + """ + + +class InitProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + attachmentTargetRef: Optional[AttachmentTargetRef] = None + """ + Reference to a Network in compute to populate attachmentTarget. + """ + attachmentTargetSelector: Optional[AttachmentTargetSelector] = None + """ + Selector for a Network in compute to populate attachmentTarget. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + attachmentTarget: Optional[str] = None + """ + The target that the firewall policy is attached to. + """ + firewallPolicy: Optional[str] = None + """ + The firewall policy of the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The location of this resource. + """ + shortName: Optional[str] = None + """ + The short name of the firewall policy of the association. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionNetworkFirewallPolicyAssociation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionNetworkFirewallPolicyAssociation']] = ( + 'RegionNetworkFirewallPolicyAssociation' + ) + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionNetworkFirewallPolicyAssociationSpec defines the desired state of RegionNetworkFirewallPolicyAssociation + """ + status: Optional[Status] = None + """ + RegionNetworkFirewallPolicyAssociationStatus defines the observed state of RegionNetworkFirewallPolicyAssociation. + """ + + +class RegionNetworkFirewallPolicyAssociationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionNetworkFirewallPolicyAssociation] + """ + List of regionnetworkfirewallpolicyassociations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionperinstanceconfig/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionperinstanceconfig/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionperinstanceconfig/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionperinstanceconfig/v1beta1.py new file mode 100644 index 000000000..48eaab390 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionperinstanceconfig/v1beta1.py @@ -0,0 +1,593 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionperinstanceconfig.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DiskItem(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + sourceRef: Optional[SourceRef] = None + """ + Reference to a Disk in compute to populate source. + """ + sourceSelector: Optional[SourceSelector] = None + """ + Selector for a Disk in compute to populate source. + """ + + +class IpAddress(BaseModel): + address: Optional[str] = None + """ + The URL of the reservation for this IP address. + """ + + +class ExternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class InternalIpItem(BaseModel): + autoDelete: Optional[str] = None + """ + These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + interfaceName: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + ipAddress: Optional[IpAddress] = None + """ + Ip address representation + Structure is documented below. + """ + + +class PreservedState(BaseModel): + disk: Optional[List[DiskItem]] = None + """ + Stateful disks for the instance. + Structure is documented below. + """ + externalIp: Optional[List[ExternalIpItem]] = None + """ + Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + internalIp: Optional[List[InternalIpItem]] = None + """ + Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + Structure is documented below. + """ + metadata: Optional[Dict[str, str]] = None + """ + Preserved metadata defined for this instance. This is a list of key->value pairs. + """ + + +class RegionInstanceGroupManagerRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionInstanceGroupManagerSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RegionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + regionInstanceGroupManagerRef: Optional[RegionInstanceGroupManagerRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionInstanceGroupManagerSelector: Optional[RegionInstanceGroupManagerSelector] = ( + None + ) + """ + Selector for a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate region. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class InitProvider(BaseModel): + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + regionInstanceGroupManagerRef: Optional[RegionInstanceGroupManagerRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionInstanceGroupManagerSelector: Optional[RegionInstanceGroupManagerSelector] = ( + None + ) + """ + Selector for a RegionInstanceGroupManager in compute to populate regionInstanceGroupManager. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a RegionInstanceGroupManager in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a RegionInstanceGroupManager in compute to populate region. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DiskItemModel(BaseModel): + deleteRule: Optional[str] = None + """ + A value that prescribes what should happen to the stateful disk when the VM instance is deleted. + The available options are NEVER and ON_PERMANENT_INSTANCE_DELETION. + NEVER - detach the disk when the VM is deleted, but do not delete the disk. + ON_PERMANENT_INSTANCE_DELETION will delete the stateful disk when the VM is permanently + deleted from the instance group. + Default value is NEVER. + Possible values are: NEVER, ON_PERMANENT_INSTANCE_DELETION. + """ + deviceName: Optional[str] = None + """ + A unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. + """ + mode: Optional[str] = None + """ + The mode of the disk. + Default value is READ_WRITE. + Possible values are: READ_ONLY, READ_WRITE. + """ + source: Optional[str] = None + """ + The URI of an existing persistent disk to attach under the specified device-name in the format + projects/project-id/zones/zone/disks/disk-name. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{region_instance_group_manager}}/{{name}} + """ + minimalAction: Optional[str] = None + """ + The minimal action to perform on the instance during an update. + Default is NONE. Possible values are: + """ + mostDisruptiveAllowedAction: Optional[str] = None + """ + The most disruptive action to perform on the instance during an update. + Default is REPLACE. Possible values are: + """ + name: Optional[str] = None + """ + The name for this per-instance config and its corresponding instance. + """ + preservedState: Optional[PreservedState] = None + """ + The preserved state for this instance. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the containing instance group manager is located + """ + regionInstanceGroupManager: Optional[str] = None + """ + The region instance group manager this instance config is part of. + """ + removeInstanceOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove the underlying instance. + When false, deleting this config will use the behavior as determined by remove_instance_on_destroy. + """ + removeInstanceStateOnDestroy: Optional[bool] = None + """ + When true, deleting this config will immediately remove any specified state from the underlying instance. + When false, deleting this config will not immediately remove any state from the underlying instance. + State will be removed on the next instance recreation or update. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionPerInstanceConfig(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionPerInstanceConfig']] = 'RegionPerInstanceConfig' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionPerInstanceConfigSpec defines the desired state of RegionPerInstanceConfig + """ + status: Optional[Status] = None + """ + RegionPerInstanceConfigStatus defines the observed state of RegionPerInstanceConfig. + """ + + +class RegionPerInstanceConfigList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionPerInstanceConfig] + """ + List of regionperinstanceconfigs. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionsecuritypolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionsecuritypolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionsecuritypolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionsecuritypolicy/v1beta1.py new file mode 100644 index 000000000..bd99d391b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionsecuritypolicy/v1beta1.py @@ -0,0 +1,730 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionsecuritypolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class DdosProtectionConfig(BaseModel): + ddosProtection: Optional[str] = None + """ + Google Cloud Armor offers the following options to help protect systems against DDoS attacks: + """ + + +class Config(BaseModel): + srcIpRanges: Optional[List[str]] = None + """ + Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + """ + + +class Expr(BaseModel): + expression: Optional[str] = None + """ + Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported. + """ + + +class Match(BaseModel): + config: Optional[Config] = None + """ + The configuration options available when specifying versionedExpr. + This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. + Structure is documented below. + """ + expr: Optional[Expr] = None + """ + User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. See Sample expressions for examples. + Structure is documented below. + """ + versionedExpr: Optional[str] = None + """ + Preconfigured versioned expression. If this field is specified, config must also be specified. + Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. + Possible values are: SRC_IPS_V1. + """ + + +class UserDefinedField(BaseModel): + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + values: Optional[List[str]] = None + """ + Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + """ + + +class NetworkMatch(BaseModel): + destIpRanges: Optional[List[str]] = None + """ + Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + """ + destPorts: Optional[List[str]] = None + """ + Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + """ + ipProtocols: Optional[List[str]] = None + """ + IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp". + """ + srcAsns: Optional[List[float]] = None + """ + BGP Autonomous System Number associated with the source IP address. + """ + srcIpRanges: Optional[List[str]] = None + """ + Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + """ + srcPorts: Optional[List[str]] = None + """ + Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + """ + srcRegionCodes: Optional[List[str]] = None + """ + Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address. + """ + userDefinedFields: Optional[List[UserDefinedField]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class RequestCookieItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class RequestHeaderItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class RequestQueryParamItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class RequestUriItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + Available options: + EQUALS: The operator matches if the field value equals the specified value. + STARTS_WITH: The operator matches if the field value starts with the specified value. + ENDS_WITH: The operator matches if the field value ends with the specified value. + CONTAINS: The operator matches if the field value contains the specified value. + EQUALS_ANY: The operator matches if the field value is any value. + Possible values are: CONTAINS, ENDS_WITH, EQUALS, EQUALS_ANY, STARTS_WITH. + """ + value: Optional[str] = None + """ + A request field matching the specified value will be excluded from inspection during preconfigured WAF evaluation. + The field value must be given if the field operator is not EQUALS_ANY, and cannot be given if the field operator is EQUALS_ANY. + """ + + +class ExclusionItem(BaseModel): + requestCookie: Optional[List[RequestCookieItem]] = None + """ + Request cookie whose value will be excluded from inspection during preconfigured WAF evaluation. + Structure is documented below. + """ + requestHeader: Optional[List[RequestHeaderItem]] = None + """ + Request header whose value will be excluded from inspection during preconfigured WAF evaluation. + Structure is documented below. + """ + requestQueryParam: Optional[List[RequestQueryParamItem]] = None + """ + Request query parameter whose value will be excluded from inspection during preconfigured WAF evaluation. + Note that the parameter can be in the query string or in the POST body. + Structure is documented below. + """ + requestUri: Optional[List[RequestUriItem]] = None + """ + Request URI from the request line to be excluded from inspection during preconfigured WAF evaluation. + When specifying this field, the query or fragment part should be excluded. + Structure is documented below. + """ + targetRuleIds: Optional[List[str]] = None + """ + A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. + If omitted, it refers to all the rule IDs under the WAF rule set. + """ + targetRuleSet: Optional[str] = None + """ + Target WAF rule set to apply the preconfigured WAF exclusion. + """ + + +class PreconfiguredWafConfig(BaseModel): + exclusion: Optional[List[ExclusionItem]] = None + """ + An exclusion to apply during preconfigured WAF evaluation. + Structure is documented below. + """ + + +class BanThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class EnforceOnKeyConfig(BaseModel): + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. + HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value. + """ + enforceOnKeyType: Optional[str] = None + """ + Determines the key to enforce the rateLimitThreshold on. Possible values are: + """ + + +class RateLimitThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class RateLimitOptions(BaseModel): + banDurationSec: Optional[float] = None + """ + Can only be specified if the action for the rule is "rate_based_ban". + If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + """ + banThreshold: Optional[BanThreshold] = None + """ + Can only be specified if the action for the rule is "rate_based_ban". + If specified, the key will be banned for the configured 'banDurationSec' when the number of requests that exceed the 'rateLimitThreshold' also exceed this 'banThreshold'. + Structure is documented below. + """ + conformAction: Optional[str] = None + """ + Action to take for requests that are under the configured rate limit threshold. + Valid option is "allow" only. + """ + enforceOnKey: Optional[str] = None + """ + Determines the key to enforce the rateLimitThreshold on. Possible values are: + """ + enforceOnKeyConfigs: Optional[List[EnforceOnKeyConfig]] = None + """ + If specified, any combination of values of enforceOnKeyType/enforceOnKeyName is treated as the key on which ratelimit threshold/action is enforced. + You can specify up to 3 enforceOnKeyConfigs. + If enforceOnKeyConfigs is specified, enforceOnKey must not be specified. + Structure is documented below. + """ + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. + HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value. + """ + exceedAction: Optional[str] = None + """ + Action to take for requests that are above the configured rate limit threshold, to deny with a specified HTTP response code. + Valid options are deny(STATUS), where valid values for STATUS are 403, 404, 429, and 502. + """ + rateLimitThreshold: Optional[RateLimitThreshold] = None + """ + Threshold at which to begin ratelimiting. + Structure is documented below. + """ + + +class Rule(BaseModel): + action: Optional[str] = None + """ + The Action to perform when the rule is matched. The following are the valid actions: + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. + If it evaluates to true, the corresponding 'action' is enforced. + Structure is documented below. + """ + networkMatch: Optional[NetworkMatch] = None + """ + A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. + The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). + Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. + Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. + For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. + Example: + networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" + The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive + Structure is documented below. + """ + preconfiguredWafConfig: Optional[PreconfiguredWafConfig] = None + """ + Preconfigured WAF configuration to be applied for the rule. + If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. + Structure is documented below. + """ + preview: Optional[bool] = None + """ + If set to true, the specified action is not enforced. + """ + priority: Optional[float] = None + """ + An integer indicating the priority of a rule in the list. + The priority must be a positive value between 0 and 2147483647. + Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority. + """ + rateLimitOptions: Optional[RateLimitOptions] = None + """ + Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions. + Structure is documented below. + """ + + +class UserDefinedFieldModel(BaseModel): + base: Optional[str] = None + """ + The base relative to which 'offset' is measured. Possible values are: + """ + mask: Optional[str] = None + """ + If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. + Encoded as a hexadecimal number (starting with "0x"). + The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + """ + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + offset: Optional[float] = None + """ + Offset of the first byte of the field (in network byte order) relative to 'base'. + """ + size: Optional[float] = None + """ + Size of the field in bytes. Valid values: 1-4. + """ + + +class ForProvider(BaseModel): + ddosProtectionConfig: Optional[DdosProtectionConfig] = None + """ + Configuration for Google Cloud Armor DDOS Proctection Config. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created Region Security Policy should reside. + If it is not provided, the provider region is used. + """ + rules: Optional[List[Rule]] = None + """ + The set of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. + """ + userDefinedFields: Optional[List[UserDefinedFieldModel]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class UserDefinedFieldModel1(BaseModel): + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + values: Optional[List[str]] = None + """ + Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + """ + + +class UserDefinedFieldModel2(BaseModel): + base: Optional[str] = None + """ + The base relative to which 'offset' is measured. Possible values are: + """ + mask: Optional[str] = None + """ + If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. + Encoded as a hexadecimal number (starting with "0x"). + The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + """ + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + offset: Optional[float] = None + """ + Offset of the first byte of the field (in network byte order) relative to 'base'. + """ + size: Optional[float] = None + """ + Size of the field in bytes. Valid values: 1-4. + """ + + +class InitProvider(BaseModel): + ddosProtectionConfig: Optional[DdosProtectionConfig] = None + """ + Configuration for Google Cloud Armor DDOS Proctection Config. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rules: Optional[List[Rule]] = None + """ + The set of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. + """ + userDefinedFields: Optional[List[UserDefinedFieldModel2]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UserDefinedFieldModel3(BaseModel): + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + values: Optional[List[str]] = None + """ + Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + """ + + +class UserDefinedFieldModel4(BaseModel): + base: Optional[str] = None + """ + The base relative to which 'offset' is measured. Possible values are: + """ + mask: Optional[str] = None + """ + If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. + Encoded as a hexadecimal number (starting with "0x"). + The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + """ + name: Optional[str] = None + """ + The name of this field. Must be unique within the policy. + """ + offset: Optional[float] = None + """ + Offset of the first byte of the field (in network byte order) relative to 'base'. + """ + size: Optional[float] = None + """ + Size of the field in bytes. Valid values: 1-4. + """ + + +class AtProvider(BaseModel): + ddosProtectionConfig: Optional[DdosProtectionConfig] = None + """ + Configuration for Google Cloud Armor DDOS Proctection Config. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. This field is used internally during + updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/securityPolicies/{{name}} + """ + policyId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created Region Security Policy should reside. + If it is not provided, the provider region is used. + """ + rules: Optional[List[Rule]] = None + """ + The set of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + Server-defined URL for the resource. + """ + selfLinkWithPolicyId: Optional[str] = None + """ + Server-defined URL for this resource with the resource id. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. + """ + userDefinedFields: Optional[List[UserDefinedFieldModel4]] = None + """ + Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. + A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. + Rules may then specify matching values for these fields. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionSecurityPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionSecurityPolicy']] = 'RegionSecurityPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionSecurityPolicySpec defines the desired state of RegionSecurityPolicy + """ + status: Optional[Status] = None + """ + RegionSecurityPolicyStatus defines the observed state of RegionSecurityPolicy. + """ + + +class RegionSecurityPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionSecurityPolicy] + """ + List of regionsecuritypolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionsslcertificate/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionsslcertificate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionsslcertificate/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionsslcertificate/v1beta1.py new file mode 100644 index 000000000..5ddcc5331 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionsslcertificate/v1beta1.py @@ -0,0 +1,270 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionsslcertificate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CertificateSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class PrivateKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class ForProvider(BaseModel): + certificateSecretRef: Optional[CertificateSecretRef] = None + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: Optional[PrivateKeySecretRef] = None + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created regional ssl certificate should reside. + If it is not provided, the provider region is used. + """ + + +class InitProvider(BaseModel): + certificateSecretRef: CertificateSecretRef + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: PrivateKeySecretRef + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateId: Optional[float] = None + """ + The unique identifier for the resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + expireTime: Optional[str] = None + """ + Expire time of the certificate in RFC3339 text format. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/sslCertificates/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the created regional ssl certificate should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionSSLCertificate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionSSLCertificate']] = 'RegionSSLCertificate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionSSLCertificateSpec defines the desired state of RegionSSLCertificate + """ + status: Optional[Status] = None + """ + RegionSSLCertificateStatus defines the observed state of RegionSSLCertificate. + """ + + +class RegionSSLCertificateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionSSLCertificate] + """ + List of regionsslcertificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionsslpolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionsslpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionsslpolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionsslpolicy/v1beta1.py new file mode 100644 index 000000000..e1f590fb1 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionsslpolicy/v1beta1.py @@ -0,0 +1,195 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionsslpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + customFeatures: Optional[List[str]] = None + description: Optional[str] = None + minTlsVersion: Optional[str] = None + profile: Optional[str] = None + project: Optional[str] = None + region: str + + +class InitProvider(BaseModel): + customFeatures: Optional[List[str]] = None + description: Optional[str] = None + minTlsVersion: Optional[str] = None + profile: Optional[str] = None + project: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + customFeatures: Optional[List[str]] = None + description: Optional[str] = None + enabledFeatures: Optional[List[str]] = None + fingerprint: Optional[str] = None + id: Optional[str] = None + minTlsVersion: Optional[str] = None + profile: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + selfLink: Optional[str] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionSSLPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionSSLPolicy']] = 'RegionSSLPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionSSLPolicySpec defines the desired state of RegionSSLPolicy + """ + status: Optional[Status] = None + """ + RegionSSLPolicyStatus defines the observed state of RegionSSLPolicy. + """ + + +class RegionSSLPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionSSLPolicy] + """ + List of regionsslpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpproxy/v1beta1.py new file mode 100644 index 000000000..23779073b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpproxy/v1beta1.py @@ -0,0 +1,333 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regiontargethttpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regional + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regional + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regional + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + region: Optional[str] = None + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the BackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionTargetHTTPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionTargetHTTPProxy']] = 'RegionTargetHTTPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionTargetHTTPProxySpec defines the desired state of RegionTargetHTTPProxy + """ + status: Optional[Status] = None + """ + RegionTargetHTTPProxyStatus defines the observed state of RegionTargetHTTPProxy. + """ + + +class RegionTargetHTTPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionTargetHTTPProxy] + """ + List of regiontargethttpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpsproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpsproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpsproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpsproxy/v1beta1.py new file mode 100644 index 000000000..ef59299ad --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regiontargethttpsproxy/v1beta1.py @@ -0,0 +1,486 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regiontargethttpsproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SslCertificatesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SslCertificatesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + sslCertificates and certificateManagerCertificates can't be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regioanl + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to RegionSSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of RegionSSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the Region SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the RegionBackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + sslCertificates and certificateManagerCertificates can't be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regioanl + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to RegionSSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of RegionSSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the Region SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the RegionBackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a RegionURLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a RegionURLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + sslCertificates and certificateManagerCertificates can't be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value (600 seconds) will be used. For Regioanl + HTTP(S) load balancer, the minimum allowed value is 5 seconds and the + maximum allowed value is 600 seconds. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + region: Optional[str] = None + """ + The Region in which the created target https proxy should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + """ + sslPolicy: Optional[str] = None + """ + A reference to the Region SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + urlMap: Optional[str] = None + """ + A reference to the RegionUrlMap resource that defines the mapping from URL + to the RegionBackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionTargetHTTPSProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionTargetHTTPSProxy']] = 'RegionTargetHTTPSProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionTargetHTTPSProxySpec defines the desired state of RegionTargetHTTPSProxy + """ + status: Optional[Status] = None + """ + RegionTargetHTTPSProxyStatus defines the observed state of RegionTargetHTTPSProxy. + """ + + +class RegionTargetHTTPSProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionTargetHTTPSProxy] + """ + List of regiontargethttpsproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiontargettcpproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regiontargettcpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regiontargettcpproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regiontargettcpproxy/v1beta1.py new file mode 100644 index 000000000..436f0fcfb --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regiontargettcpproxy/v1beta1.py @@ -0,0 +1,342 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regiontargettcpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + region: str + """ + The Region in which the created target TCP proxy should reside. + If it is not provided, the provider region is used. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetTcpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + region: Optional[str] = None + """ + The Region in which the created target TCP proxy should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionTargetTCPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionTargetTCPProxy']] = 'RegionTargetTCPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionTargetTCPProxySpec defines the desired state of RegionTargetTCPProxy + """ + status: Optional[Status] = None + """ + RegionTargetTCPProxyStatus defines the observed state of RegionTargetTCPProxy. + """ + + +class RegionTargetTCPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionTargetTCPProxy] + """ + List of regiontargettcpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionurlmap/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/regionurlmap/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/regionurlmap/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/regionurlmap/v1beta1.py new file mode 100644 index 000000000..ca834fccd --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/regionurlmap/v1beta1.py @@ -0,0 +1,2413 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_regionurlmap.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CorsPolicy(BaseModel): + allowCredentials: Optional[bool] = None + """ + In response to a preflight request, setting this to true indicates that the + actual request can include user credentials. This translates to the Access- + Control-Allow-Credentials header. Defaults to false. + """ + allowHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Headers header. + """ + allowMethods: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Methods header. + """ + allowOriginRegexes: Optional[List[str]] = None + """ + Specifies the regular expression patterns that match allowed origins. For + regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + An origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + allowOrigins: Optional[List[str]] = None + """ + Specifies the list of origins that will be allowed to do CORS requests. An + origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + disabled: Optional[bool] = None + """ + If true, specifies the CORS policy is disabled. + which indicates that the CORS policy is in effect. Defaults to false. + """ + exposeHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Expose-Headers header. + """ + maxAge: Optional[float] = None + """ + Specifies how long the results of a preflight request can be cached. This + translates to the content for the Access-Control-Max-Age header. + """ + + +class Abort(BaseModel): + httpStatus: Optional[float] = None + """ + The HTTP status code used to abort the request. The value must be between 200 + and 599 inclusive. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FixedDelay(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class Delay(BaseModel): + fixedDelay: Optional[FixedDelay] = None + """ + Specifies the value of the fixed delay interval. + Structure is documented below. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FaultInjectionPolicy(BaseModel): + abort: Optional[Abort] = None + """ + The specification for how client requests are aborted as part of fault + injection. + Structure is documented below. + """ + delay: Optional[Delay] = None + """ + The specification for how client requests are delayed as part of fault + injection, before being sent to a backend service. + Structure is documented below. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RequestMirrorPolicy(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + + +class PerTryTimeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class RetryPolicy(BaseModel): + numRetries: Optional[float] = None + """ + Specifies the allowed number retries. This number must be > 0. + """ + perTryTimeout: Optional[PerTryTimeout] = None + """ + Specifies a non-zero timeout per retry attempt. + Structure is documented below. + """ + retryConditions: Optional[List[str]] = None + """ + Specifies one or more conditions when this retry rule applies. Valid values are: + """ + + +class Timeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewrite(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class ResponseHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class HeaderAction(BaseModel): + requestHeadersToAdd: Optional[List[RequestHeadersToAddItem]] = None + """ + Headers to add to a matching request prior to forwarding the request to the + backendService. + Structure is documented below. + """ + requestHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the request + prior to forwarding the request to the backendService. + """ + responseHeadersToAdd: Optional[List[ResponseHeadersToAddItem]] = None + """ + Headers to add the response prior to sending the response back to the client. + Structure is documented below. + """ + responseHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the response + prior to sending the response back to the client. + """ + + +class WeightedBackendService(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DefaultServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultUrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class HostRuleItem(BaseModel): + description: Optional[str] = None + """ + An optional description of this HostRule. Provide this property + when you create the resource. + """ + hosts: Optional[List[str]] = None + """ + The list of host patterns to match. They must be valid + hostnames, except * will match any string of ([a-z0-9-.]*). In + that case, * must be the first character and must be followed in + the pattern by either - or .. + """ + pathMatcher: Optional[str] = None + """ + The name of the PathMatcher to use to match the path portion of + the URL if the hostRule matches the URL's host portion. + """ + + +class MaxStreamDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewriteModel(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionModel(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteModel1(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel1] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class PathRuleItem(BaseModel): + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class RangeMatch(BaseModel): + rangeEnd: Optional[float] = None + """ + The end of the range (exclusive). + """ + rangeStart: Optional[float] = None + """ + The start of the range (inclusive). + """ + + +class HeaderMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + headerName: Optional[str] = None + """ + The name of the header. + """ + invertMatch: Optional[bool] = None + """ + If set to false, the headerMatch is considered a match if the match criteria + above are met. If set to true, the headerMatch is considered a match if the + match criteria above are NOT met. Defaults to false. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + rangeMatch: Optional[RangeMatch] = None + """ + The header value must be an integer and its value must be in the range specified + in rangeMatch. If the header does not contain an integer, number or is empty, + the match fails. For example for a range [-5, 0] + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + suffixMatch: Optional[str] = None + """ + The value of the header must end with the contents of suffixMatch. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + The value of the label must match the specified value. value can have a maximum + length of 1024 characters. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the provided metadata + based on filterMatchCriteria This list must not be empty and can have at the + most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of filterLabels + contribute towards the overall metadataFilter match. Supported values are: + """ + + +class QueryParameterMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class MatchRule(BaseModel): + fullPathMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request must exactly + match the value specified in fullPathMatch after removing any query parameters + and anchor that may be part of the original URL. FullPathMatch must be between 1 + and 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must + be specified. + """ + headerMatches: Optional[List[HeaderMatch]] = None + """ + Specifies a list of header match criteria, all of which must match corresponding + headers in the request. + Structure is documented below. + """ + ignoreCase: Optional[bool] = None + """ + Specifies that prefixMatch and fullPathMatch matches are case sensitive. + Defaults to false. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing configuration to + a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS + clients present node metadata. If a match takes place, the relevant routing + configuration is made available to those proxies. For each metadataFilter in + this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the + filterLabels must match the corresponding label provided in the metadata. If its + filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match + with corresponding labels in the provided metadata. metadataFilters specified + here can be overrides those specified in ForwardingRule that refers to this + UrlMap. metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + pathTemplateMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request + must match the wildcard pattern specified in pathTemplateMatch + after removing any query parameters and anchor that may be part + of the original URL. + pathTemplateMatch must be between 1 and 255 characters + (inclusive). The pattern specified by pathTemplateMatch may + have at most 5 wildcard operators and at most 5 variable + captures in total. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + queryParameterMatches: Optional[List[QueryParameterMatch]] = None + """ + Specifies a list of query parameter match criteria, all of which must match + corresponding query parameters in the request. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class RequestMirrorPolicyModel(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel2(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteRule(BaseModel): + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItem(BaseModel): + defaultRouteAction: Optional[DefaultRouteActionModel] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + A reference to a RegionBackendService resource. This will be used if + none of the pathRules defined by this PathMatcher is matched by + the URL's path portion. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItem]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRule]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItem(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate service. + """ + + +class ForProvider(BaseModel): + defaultRouteAction: Optional[DefaultRouteAction] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirect] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The Region in which the url map should reside. + If it is not provided, the provider region is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class RequestMirrorPolicyModel1(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + + +class UrlRewriteModel3(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class WeightedBackendServiceModel1(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteActionModel1(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel3] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel1(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class UrlRewriteModel4(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionModel2(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel4] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel2(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteModel5(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestMirrorPolicyModel2(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel6(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel2(BaseModel): + backendService: Optional[str] = None + """ + The default RegionBackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class InitProvider(BaseModel): + defaultRouteAction: Optional[DefaultRouteActionModel1] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a RegionBackendService in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a RegionBackendService in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel1] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UrlRewriteModel7(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionModel3(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel7] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel2]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non-zero number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel3(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class UrlRewriteModel8(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class DefaultRouteActionModel4(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel8] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel2]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel4(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. The default value is false. + """ + + +class UrlRewriteModel9(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class PathRuleItemModel(BaseModel): + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class UrlRewriteModel10(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class RouteRuleModel(BaseModel): + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItemModel(BaseModel): + defaultRouteAction: Optional[DefaultRouteActionModel4] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + A reference to a RegionBackendService resource. This will be used if + none of the pathRules defined by this PathMatcher is matched by + the URL's path portion. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel4] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItemModel]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRuleModel]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItemModel(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + A reference to expected RegionBackendService resource the given URL should be mapped to. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + defaultRouteAction: Optional[DefaultRouteActionModel3] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + URL maps for Classic external HTTP(S) load balancers only support the urlRewrite action within defaultRouteAction. + defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The full or partial URL of the defaultService resource to which traffic is directed if + none of the hostRules match. If defaultRouteAction is additionally specified, advanced + routing actions like URL Rewrites, etc. take effect prior to sending the request to the + backend. However, if defaultService is specified, defaultRouteAction cannot contain any + weightedBackendServices. Conversely, if routeAction specifies any + weightedBackendServices, service must not be specified. Only one of defaultService, + defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel3] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. This field is used internally during + updates of this resource. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/urlMaps/{{name}} + """ + mapId: Optional[float] = None + """ + The unique identifier for the resource. + """ + pathMatcher: Optional[List[PathMatcherItemModel]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The Region in which the url map should reside. + If it is not provided, the provider region is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + test: Optional[List[TestItemModel]] = None + """ + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RegionURLMap(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RegionURLMap']] = 'RegionURLMap' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegionURLMapSpec defines the desired state of RegionURLMap + """ + status: Optional[Status] = None + """ + RegionURLMapStatus defines the observed state of RegionURLMap. + """ + + +class RegionURLMapList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RegionURLMap] + """ + List of regionurlmaps. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/reservation/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/reservation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/reservation/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/reservation/v1beta1.py new file mode 100644 index 000000000..ea6a7b452 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/reservation/v1beta1.py @@ -0,0 +1,517 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_reservation.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class DeleteAfterDuration(BaseModel): + nanos: Optional[float] = None + """ + Number of nanoseconds for the auto-delete duration. + """ + seconds: Optional[str] = None + """ + Number of seconds for the auto-delete duration. + """ + + +class ReservationSharingPolicy(BaseModel): + serviceShareType: Optional[str] = None + """ + Sharing config for all Google Cloud services. + Possible values are: ALLOW_ALL, DISALLOW_ALL. + """ + + +class ProjectMapItem(BaseModel): + id: Optional[str] = None + """ + The identifier for this object. Format specified above. + """ + projectId: Optional[str] = None + """ + The project id/number, should be same as the key of this project config in the project map. + """ + + +class ShareSettings(BaseModel): + projectMap: Optional[List[ProjectMapItem]] = None + """ + A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. + Structure is documented below. + """ + shareType: Optional[str] = None + """ + Type of sharing for this shared-reservation + Possible values are: LOCAL, SPECIFIC_PROJECTS. + """ + + +class GuestAccelerator(BaseModel): + acceleratorCount: Optional[float] = None + """ + The number of the guest accelerator cards exposed to + this instance. + """ + acceleratorType: Optional[str] = None + """ + The full or partial URL of the accelerator type to + attach to this instance. For example: + projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 + If you are creating an instance template, specify only the accelerator name. + """ + + +class LocalSsd(BaseModel): + diskSizeGb: Optional[float] = None + """ + The size of the disk in base-2 GB. + """ + interface: Optional[str] = None + """ + The disk interface to use for attaching this disk. + Default value is SCSI. + Possible values are: SCSI, NVME. + """ + + +class InstanceProperties(BaseModel): + guestAccelerators: Optional[List[GuestAccelerator]] = None + """ + Guest accelerator type and count. + Structure is documented below. + """ + localSsds: Optional[List[LocalSsd]] = None + """ + The amount of local ssd to reserve with each instance. This + reserves disks of type local-ssd. + Structure is documented below. + """ + machineType: Optional[str] = None + """ + The name of the machine type to reserve. + """ + minCpuPlatform: Optional[str] = None + """ + The minimum CPU platform for the reservation. For example, + "Intel Skylake". See + the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) + for information on available CPU platforms. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceInstanceTemplateRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceInstanceTemplateSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SpecificReservation(BaseModel): + count: Optional[float] = None + """ + The number of resources that are allocated. + """ + instanceProperties: Optional[InstanceProperties] = None + """ + The instance properties for the reservation. + Structure is documented below. + """ + sourceInstanceTemplate: Optional[str] = None + """ + Specifies the instance template to create the reservation. If you use this field, you must exclude the + instanceProperties field. + """ + sourceInstanceTemplateRef: Optional[SourceInstanceTemplateRef] = None + """ + Reference to a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + sourceInstanceTemplateSelector: Optional[SourceInstanceTemplateSelector] = None + """ + Selector for a InstanceTemplate in compute to populate sourceInstanceTemplate. + """ + + +class ForProvider(BaseModel): + deleteAfterDuration: Optional[DeleteAfterDuration] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[ReservationSharingPolicy] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + shareSettings: Optional[ShareSettings] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[SpecificReservation] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + zone: str + """ + The zone where the reservation is made. + """ + + +class InitProvider(BaseModel): + deleteAfterDuration: Optional[DeleteAfterDuration] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[ReservationSharingPolicy] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + shareSettings: Optional[ShareSettings] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[SpecificReservation] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SpecificReservationModel(BaseModel): + count: Optional[float] = None + """ + The number of resources that are allocated. + """ + inUseCount: Optional[float] = None + """ + (Output) + How many instances are in use. + """ + instanceProperties: Optional[InstanceProperties] = None + """ + The instance properties for the reservation. + Structure is documented below. + """ + sourceInstanceTemplate: Optional[str] = None + """ + Specifies the instance template to create the reservation. If you use this field, you must exclude the + instanceProperties field. + """ + + +class AtProvider(BaseModel): + commitment: Optional[str] = None + """ + Full or partial URL to a parent commitment. This field displays for + reservations that are tied to a commitment. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + deleteAfterDuration: Optional[DeleteAfterDuration] = None + """ + Duration after which the reservation will be auto-deleted by Compute Engine. Cannot be used with delete_at_time. + Structure is documented below. + """ + deleteAtTime: Optional[str] = None + """ + Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented in RFC3339 text format. + Cannot be used with delete_after_duration. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/reservations/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + reservationSharingPolicy: Optional[ReservationSharingPolicy] = None + """ + Sharing policy for reservations with Google Cloud managed services. + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + shareSettings: Optional[ShareSettings] = None + """ + The share setting for reservations. + Structure is documented below. + """ + specificReservation: Optional[SpecificReservationModel] = None + """ + Reservation for instances with specific machine shapes. + Structure is documented below. + """ + specificReservationRequired: Optional[bool] = None + """ + When set to true, only VMs that target this reservation by name can + consume this reservation. Otherwise, it can be consumed by VMs with + affinity for any reservation. Defaults to false. + """ + status: Optional[str] = None + """ + The status of the reservation. + """ + zone: Optional[str] = None + """ + The zone where the reservation is made. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Reservation(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Reservation']] = 'Reservation' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ReservationSpec defines the desired state of Reservation + """ + status: Optional[Status] = None + """ + ReservationStatus defines the observed state of Reservation. + """ + + +class ReservationList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Reservation] + """ + List of reservations. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/resourcepolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/resourcepolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/resourcepolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/resourcepolicy/v1beta1.py new file mode 100644 index 000000000..06486dc19 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/resourcepolicy/v1beta1.py @@ -0,0 +1,500 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_resourcepolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class DiskConsistencyGroupPolicy(BaseModel): + enabled: Optional[bool] = None + """ + Enable disk consistency on the resource policy. + """ + + +class GroupPlacementPolicy(BaseModel): + availabilityDomainCount: Optional[float] = None + """ + The number of availability domains instances will be spread across. If two instances are in different + availability domain, they will not be put in the same low latency network + """ + collocation: Optional[str] = None + """ + Collocation specifies whether to place VMs inside the same availability domain on the same low-latency network. + Specify COLLOCATED to enable collocation. Can only be specified with vm_count. If compute instances are created + with a COLLOCATED policy, then exactly vm_count instances must be created at the same time with the resource policy + attached. + Possible values are: COLLOCATED. + """ + gpuTopology: Optional[str] = None + """ + Specifies the shape of the GPU slice, in slice based GPU families eg. A4X. + """ + vmCount: Optional[float] = None + """ + Number of VMs in this placement group. Google does not recommend that you use this field + unless you use a compact policy and you want your policy to work only if it contains this + exact number of VMs. + """ + + +class VmStartSchedule(BaseModel): + schedule: Optional[str] = None + """ + Specifies the frequency for the operation, using the unix-cron format. + """ + + +class VmStopSchedule(BaseModel): + schedule: Optional[str] = None + """ + Specifies the frequency for the operation, using the unix-cron format. + """ + + +class InstanceSchedulePolicy(BaseModel): + expirationTime: Optional[str] = None + """ + The expiration time of the schedule. The timestamp is an RFC3339 string. + """ + startTime: Optional[str] = None + """ + The start time of the schedule. The timestamp is an RFC3339 string. + """ + timeZone: Optional[str] = None + """ + Specifies the time zone to be used in interpreting the schedule. The value of this field must be a time zone name + from the tz database: http://en.wikipedia.org/wiki/Tz_database. + """ + vmStartSchedule: Optional[VmStartSchedule] = None + """ + Specifies the schedule for starting instances. + Structure is documented below. + """ + vmStopSchedule: Optional[VmStopSchedule] = None + """ + Specifies the schedule for stopping instances. + Structure is documented below. + """ + + +class RetentionPolicy(BaseModel): + maxRetentionDays: Optional[float] = None + """ + Maximum age of the snapshot that is allowed to be kept. + """ + onSourceDiskDelete: Optional[str] = None + """ + Specifies the behavior to apply to scheduled snapshots when + the source disk is deleted. + Default value is KEEP_AUTO_SNAPSHOTS. + Possible values are: KEEP_AUTO_SNAPSHOTS, APPLY_RETENTION_POLICY. + """ + + +class DailySchedule(BaseModel): + daysInCycle: Optional[float] = None + """ + Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle. Days in cycle for snapshot schedule policy must be 1. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class HourlySchedule(BaseModel): + hoursInCycle: Optional[float] = None + """ + The number of hours between snapshots. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class DayOfWeek(BaseModel): + day: Optional[str] = None + """ + The day of the week to create the snapshot. e.g. MONDAY + Possible values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + """ + startTime: Optional[str] = None + """ + Time within the window to start the operations. + It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + """ + + +class WeeklySchedule(BaseModel): + dayOfWeeks: Optional[List[DayOfWeek]] = None + """ + May contain up to seven (one for each day of the week) snapshot times. + Structure is documented below. + """ + + +class Schedule(BaseModel): + dailySchedule: Optional[DailySchedule] = None + """ + The policy will execute every nth day at the specified time. + Structure is documented below. + """ + hourlySchedule: Optional[HourlySchedule] = None + """ + The policy will execute every nth hour starting at the specified time. + Structure is documented below. + """ + weeklySchedule: Optional[WeeklySchedule] = None + """ + Allows specifying a snapshot time for each day of the week. + Structure is documented below. + """ + + +class SnapshotProperties(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and comply + with RFC1035. + """ + guestFlush: Optional[bool] = None + """ + Whether to perform a 'guest aware' snapshot. + """ + labels: Optional[Dict[str, str]] = None + """ + A set of key-value pairs. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket location to store the auto snapshot + (regional or multi-regional) + """ + + +class SnapshotSchedulePolicy(BaseModel): + retentionPolicy: Optional[RetentionPolicy] = None + """ + Retention policy applied to snapshots created by this resource policy. + Structure is documented below. + """ + schedule: Optional[Schedule] = None + """ + Contains one of an hourlySchedule, dailySchedule, or weeklySchedule. + Structure is documented below. + """ + snapshotProperties: Optional[SnapshotProperties] = None + """ + Properties with which the snapshots are created, such as labels. + Structure is documented below. + """ + + +class WorkloadPolicy(BaseModel): + acceleratorTopology: Optional[str] = None + """ + The accelerator topology. This field can be set only when the workload policy type is HIGH_THROUGHPUT + and cannot be set if max topology distance is set. + """ + maxTopologyDistance: Optional[str] = None + """ + The maximum topology distance. This field can be set only when the workload policy type is HIGH_THROUGHPUT + and cannot be set if accelerator topology is set. + Possible values are: BLOCK, CLUSTER, SUBBLOCK. + """ + type: Optional[str] = None + """ + The type of workload policy. + Possible values are: HIGH_AVAILABILITY, HIGH_THROUGHPUT. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[DiskConsistencyGroupPolicy] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[GroupPlacementPolicy] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + instanceSchedulePolicy: Optional[InstanceSchedulePolicy] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where resource policy resides. + """ + snapshotSchedulePolicy: Optional[SnapshotSchedulePolicy] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[WorkloadPolicy] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[DiskConsistencyGroupPolicy] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[GroupPlacementPolicy] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + instanceSchedulePolicy: Optional[InstanceSchedulePolicy] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotSchedulePolicy: Optional[SnapshotSchedulePolicy] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[WorkloadPolicy] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create the resource. + """ + diskConsistencyGroupPolicy: Optional[DiskConsistencyGroupPolicy] = None + """ + Replication consistency group for asynchronous disk replication. + Structure is documented below. + """ + groupPlacementPolicy: Optional[GroupPlacementPolicy] = None + """ + Resource policy for instances used for placement configuration. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/resourcePolicies/{{name}} + """ + instanceSchedulePolicy: Optional[InstanceSchedulePolicy] = None + """ + Resource policy for scheduling instance operations. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where resource policy resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + snapshotSchedulePolicy: Optional[SnapshotSchedulePolicy] = None + """ + Policy for creating snapshots of persistent disks. + Structure is documented below. + """ + workloadPolicy: Optional[WorkloadPolicy] = None + """ + Represents the workload policy. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ResourcePolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ResourcePolicy']] = 'ResourcePolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ResourcePolicySpec defines the desired state of ResourcePolicy + """ + status: Optional[Status] = None + """ + ResourcePolicyStatus defines the observed state of ResourcePolicy. + """ + + +class ResourcePolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ResourcePolicy] + """ + List of resourcepolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/route/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/route/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/route/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/route/v1beta1.py new file mode 100644 index 000000000..4e2dd627f --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/route/v1beta1.py @@ -0,0 +1,659 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_route.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NextHopIlbRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NextHopIlbSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NextHopVpnTunnelRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NextHopVpnTunnelSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the route. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property + when you create the resource. + """ + destRange: Optional[str] = None + """ + The destination range of outgoing packets that this route applies to. + Only IPv4 is supported. + """ + network: Optional[str] = None + """ + The network that this route applies to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nextHopGateway: Optional[str] = None + """ + URL to a gateway that should handle matching packets. + Currently, you can only specify the internet gateway, using a full or + partial valid URL: + """ + nextHopIlb: Optional[str] = None + """ + The IP address or URL to a forwarding rule of type + loadBalancingScheme=INTERNAL that should handle matching + packets. + With the GA provider you can only specify the forwarding + rule as a partial or full URL. For example, the following + are all valid values: + """ + nextHopIlbRef: Optional[NextHopIlbRef] = None + """ + Reference to a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopIlbSelector: Optional[NextHopIlbSelector] = None + """ + Selector for a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopInstance: Optional[str] = None + """ + URL to an instance that should handle matching packets. + You can specify this as a full or partial URL. For example: + """ + nextHopInstanceZone: Optional[str] = None + """ + . + """ + nextHopIp: Optional[str] = None + """ + Network IP address of an instance that should handle matching packets. + """ + nextHopVpnTunnel: Optional[str] = None + """ + URL to a VpnTunnel that should handle matching packets. + """ + nextHopVpnTunnelRef: Optional[NextHopVpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + nextHopVpnTunnelSelector: Optional[NextHopVpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + The priority of this route. Priority is used to break ties in cases + where there is more than one matching route of equal prefix length. + In the case of two routes with equal prefix length, the one with the + lowest-numbered priority value wins. + Default value is 1000. Valid range is 0 through 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + tags: Optional[List[str]] = None + """ + A list of instance tags to which this route applies. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property + when you create the resource. + """ + destRange: Optional[str] = None + """ + The destination range of outgoing packets that this route applies to. + Only IPv4 is supported. + """ + network: Optional[str] = None + """ + The network that this route applies to. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + nextHopGateway: Optional[str] = None + """ + URL to a gateway that should handle matching packets. + Currently, you can only specify the internet gateway, using a full or + partial valid URL: + """ + nextHopIlb: Optional[str] = None + """ + The IP address or URL to a forwarding rule of type + loadBalancingScheme=INTERNAL that should handle matching + packets. + With the GA provider you can only specify the forwarding + rule as a partial or full URL. For example, the following + are all valid values: + """ + nextHopIlbRef: Optional[NextHopIlbRef] = None + """ + Reference to a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopIlbSelector: Optional[NextHopIlbSelector] = None + """ + Selector for a ForwardingRule in compute to populate nextHopIlb. + """ + nextHopInstance: Optional[str] = None + """ + URL to an instance that should handle matching packets. + You can specify this as a full or partial URL. For example: + """ + nextHopInstanceZone: Optional[str] = None + """ + . + """ + nextHopIp: Optional[str] = None + """ + Network IP address of an instance that should handle matching packets. + """ + nextHopVpnTunnel: Optional[str] = None + """ + URL to a VpnTunnel that should handle matching packets. + """ + nextHopVpnTunnelRef: Optional[NextHopVpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + nextHopVpnTunnelSelector: Optional[NextHopVpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate nextHopVpnTunnel. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + The priority of this route. Priority is used to break ties in cases + where there is more than one matching route of equal prefix length. + In the case of two routes with equal prefix length, the one with the + lowest-numbered priority value wins. + Default value is 1000. Valid range is 0 through 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + tags: Optional[List[str]] = None + """ + A list of instance tags to which this route applies. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AsPath(BaseModel): + asLists: Optional[List[float]] = None + """ + (Output) + The AS numbers of the AS Path. + """ + pathSegmentType: Optional[str] = None + """ + (Output) + The type of the AS Path, which can be one of the following values: + """ + + +class Datum(BaseModel): + key: Optional[str] = None + """ + (Output) + A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + """ + value: Optional[str] = None + """ + (Output) + A warning data value corresponding to the key. + """ + + +class Warning(BaseModel): + code: Optional[str] = None + """ + (Output) + A warning code, if applicable. For example, Compute Engine returns + NO_RESULTS_ON_PAGE if there are no results in the response. + """ + data: Optional[List[Datum]] = None + """ + (Output) + Metadata about this warning in key: value format. For example: + "data": [ { "key": "scope", "value": "zones/us-east1-d" } + Structure is documented below. + """ + message: Optional[str] = None + """ + (Output) + A human-readable description of the warning code. + """ + + +class AtProvider(BaseModel): + asPaths: Optional[List[AsPath]] = None + """ + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property + when you create the resource. + """ + destRange: Optional[str] = None + """ + The destination range of outgoing packets that this route applies to. + Only IPv4 is supported. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/routes/{{name}} + """ + network: Optional[str] = None + """ + The network that this route applies to. + """ + nextHopGateway: Optional[str] = None + """ + URL to a gateway that should handle matching packets. + Currently, you can only specify the internet gateway, using a full or + partial valid URL: + """ + nextHopHub: Optional[str] = None + """ + The hub network that should handle matching packets, which should conform to RFC1035. + """ + nextHopIlb: Optional[str] = None + """ + The IP address or URL to a forwarding rule of type + loadBalancingScheme=INTERNAL that should handle matching + packets. + With the GA provider you can only specify the forwarding + rule as a partial or full URL. For example, the following + are all valid values: + """ + nextHopInstance: Optional[str] = None + """ + URL to an instance that should handle matching packets. + You can specify this as a full or partial URL. For example: + """ + nextHopInstanceZone: Optional[str] = None + """ + . + """ + nextHopInterRegionCost: Optional[str] = None + """ + Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions. + """ + nextHopIp: Optional[str] = None + """ + Network IP address of an instance that should handle matching packets. + """ + nextHopMed: Optional[str] = None + """ + Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network. + """ + nextHopNetwork: Optional[str] = None + """ + URL to a Network that should handle matching packets. + """ + nextHopOrigin: Optional[str] = None + """ + Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE. + """ + nextHopPeering: Optional[str] = None + """ + The network peering name that should handle matching packets, which should conform to RFC1035. + """ + nextHopVpnTunnel: Optional[str] = None + """ + URL to a VpnTunnel that should handle matching packets. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + priority: Optional[float] = None + """ + The priority of this route. Priority is used to break ties in cases + where there is more than one matching route of equal prefix length. + In the case of two routes with equal prefix length, the one with the + lowest-numbered priority value wins. + Default value is 1000. Valid range is 0 through 65535. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + routeStatus: Optional[str] = None + """ + The status of the route, which can be one of the following values: + """ + routeType: Optional[str] = None + """ + The type of this route, which can be one of the following values: + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + tags: Optional[List[str]] = None + """ + A list of instance tags to which this route applies. + """ + warnings: Optional[List[Warning]] = None + """ + If potential misconfigurations are detected for this route, this field will be populated with warning messages. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Route(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Route']] = 'Route' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouteSpec defines the desired state of Route + """ + status: Optional[Status] = None + """ + RouteStatus defines the observed state of Route. + """ + + +class RouteList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Route] + """ + List of routes. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/router/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/router/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/router/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/router/v1beta1.py new file mode 100644 index 000000000..39f47a462 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/router/v1beta1.py @@ -0,0 +1,423 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_router.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvertisedIpRange(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + range: Optional[str] = None + """ + The IP range to advertise. The value must be a + CIDR-formatted string. + """ + + +class Bgp(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom mode. + This field can only be populated if advertiseMode is CUSTOM and + is advertised to all peers of the router. These groups will be + advertised in addition to any specified prefixes. Leave this field + blank to advertise no custom groups. + This enum field has the one valid value: ALL_SUBNETS + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + asn: Optional[float] = None + """ + Local BGP Autonomous System Number (ASN). Must be an RFC6996 + private ASN, either 16-bit or 32-bit. The value will be fixed for + this router resource. All VPN tunnels that link to this router + will have the same local ASN. + """ + identifierRange: Optional[str] = None + """ + Explicitly specifies a range of valid BGP Identifiers for this Router. + It is provided as a link-local IPv4 range (from 169.254.0.0/16), of + size at least /30, even if the BGP sessions are over IPv6. It must + not overlap with any IPv4 BGP session ranges. Other vendors commonly + call this router ID. + """ + keepaliveInterval: Optional[float] = None + """ + The interval in seconds between BGP keepalive messages that are sent + to the peer. Hold time is three times the interval at which keepalive + messages are sent, and the hold time is the maximum number of seconds + allowed to elapse between successive keepalive messages that BGP + receives from a peer. + BGP will use the smaller of either the local hold time value or the + peer's hold time value as the hold time for the BGP connection + between the two peers. If set, this value must be between 20 and 60. + The default is 20. + """ + + +class Md5AuthenticationKeys(BaseModel): + key: Optional[str] = None + """ + Value of the key used for MD5 authentication. + """ + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. + Must be referenced by exactly one bgpPeer. Must comply with RFC1035. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + bgp: Optional[Bgp] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + md5AuthenticationKeys: Optional[Md5AuthenticationKeys] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the router resides. + """ + + +class InitProvider(BaseModel): + bgp: Optional[Bgp] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + md5AuthenticationKeys: Optional[Md5AuthenticationKeys] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bgp: Optional[Bgp] = None + """ + BGP information specific to this router. + Structure is documented below. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + encryptedInterconnectRouter: Optional[bool] = None + """ + Indicates if a router is dedicated for use with encrypted VLAN + attachments (interconnectAttachments). + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{name}} + """ + md5AuthenticationKeys: Optional[Md5AuthenticationKeys] = None + """ + Keys used for MD5 authentication. + Structure is documented below. + """ + network: Optional[str] = None + """ + A reference to the network to which this router belongs. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Router(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Router']] = 'Router' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterSpec defines the desired state of Router + """ + status: Optional[Status] = None + """ + RouterStatus defines the observed state of Router. + """ + + +class RouterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Router] + """ + List of routers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/routerinterface/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/routerinterface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/routerinterface/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/routerinterface/v1beta1.py new file mode 100644 index 000000000..02888625d --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/routerinterface/v1beta1.py @@ -0,0 +1,464 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_routerinterface.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class VpnTunnelRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class VpnTunnelSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + interconnectAttachment: Optional[str] = None + """ + The name or resource link to the + VLAN interconnect for this interface. Changing this forces a new interface to + be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + ipRange: Optional[str] = None + """ + IP address and range of the interface. The IP range must be + in the RFC3927 link-local IP space. Changing this forces a new interface to be created. + """ + ipVersion: Optional[str] = None + """ + IP version of this interface. Can be either IPV4 or IPV6. + """ + name: Optional[str] = None + """ + A unique name for the interface, required by GCE. Changing + this forces a new interface to be created. + """ + privateIpAddress: Optional[str] = None + """ + The regional private internal IP address that is used + to establish BGP sessions to a VM instance acting as a third-party Router Appliance. Changing this forces a new interface to be created. + """ + project: Optional[str] = None + """ + The ID of the project in which this interface's router belongs. + If it is not provided, the provider project is used. Changing this forces a new interface to be created. + """ + redundantInterface: Optional[str] = None + """ + The name of the interface that is redundant to + this interface. Changing this forces a new interface to be created. + """ + region: Optional[str] = None + """ + The region this interface's router sits in. + If not specified, the project region will be used. Changing this forces a new interface to be created. + """ + router: Optional[str] = None + """ + The name of the router this interface will be attached to. + Changing this forces a new interface to be created. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + subnetwork: Optional[str] = None + """ + The URI of the subnetwork resource that this interface + belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. Changing this forces a new interface to be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnel: Optional[str] = None + """ + The name or resource link to the VPN tunnel this + interface will be linked to. Changing this forces a new interface to be created. Only + one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnelRef: Optional[VpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate vpnTunnel. + """ + vpnTunnelSelector: Optional[VpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate vpnTunnel. + """ + + +class InitProvider(BaseModel): + interconnectAttachment: Optional[str] = None + """ + The name or resource link to the + VLAN interconnect for this interface. Changing this forces a new interface to + be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + ipRange: Optional[str] = None + """ + IP address and range of the interface. The IP range must be + in the RFC3927 link-local IP space. Changing this forces a new interface to be created. + """ + ipVersion: Optional[str] = None + """ + IP version of this interface. Can be either IPV4 or IPV6. + """ + name: Optional[str] = None + """ + A unique name for the interface, required by GCE. Changing + this forces a new interface to be created. + """ + privateIpAddress: Optional[str] = None + """ + The regional private internal IP address that is used + to establish BGP sessions to a VM instance acting as a third-party Router Appliance. Changing this forces a new interface to be created. + """ + project: Optional[str] = None + """ + The ID of the project in which this interface's router belongs. + If it is not provided, the provider project is used. Changing this forces a new interface to be created. + """ + redundantInterface: Optional[str] = None + """ + The name of the interface that is redundant to + this interface. Changing this forces a new interface to be created. + """ + region: Optional[str] = None + """ + The region this interface's router sits in. + If not specified, the project region will be used. Changing this forces a new interface to be created. + """ + router: Optional[str] = None + """ + The name of the router this interface will be attached to. + Changing this forces a new interface to be created. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + subnetwork: Optional[str] = None + """ + The URI of the subnetwork resource that this interface + belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. Changing this forces a new interface to be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnel: Optional[str] = None + """ + The name or resource link to the VPN tunnel this + interface will be linked to. Changing this forces a new interface to be created. Only + one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnelRef: Optional[VpnTunnelRef] = None + """ + Reference to a VPNTunnel in compute to populate vpnTunnel. + """ + vpnTunnelSelector: Optional[VpnTunnelSelector] = None + """ + Selector for a VPNTunnel in compute to populate vpnTunnel. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{region}}/{{router}}/{{name}} + """ + interconnectAttachment: Optional[str] = None + """ + The name or resource link to the + VLAN interconnect for this interface. Changing this forces a new interface to + be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + ipRange: Optional[str] = None + """ + IP address and range of the interface. The IP range must be + in the RFC3927 link-local IP space. Changing this forces a new interface to be created. + """ + ipVersion: Optional[str] = None + """ + IP version of this interface. Can be either IPV4 or IPV6. + """ + name: Optional[str] = None + """ + A unique name for the interface, required by GCE. Changing + this forces a new interface to be created. + """ + privateIpAddress: Optional[str] = None + """ + The regional private internal IP address that is used + to establish BGP sessions to a VM instance acting as a third-party Router Appliance. Changing this forces a new interface to be created. + """ + project: Optional[str] = None + """ + The ID of the project in which this interface's router belongs. + If it is not provided, the provider project is used. Changing this forces a new interface to be created. + """ + redundantInterface: Optional[str] = None + """ + The name of the interface that is redundant to + this interface. Changing this forces a new interface to be created. + """ + region: Optional[str] = None + """ + The region this interface's router sits in. + If not specified, the project region will be used. Changing this forces a new interface to be created. + """ + router: Optional[str] = None + """ + The name of the router this interface will be attached to. + Changing this forces a new interface to be created. + """ + subnetwork: Optional[str] = None + """ + The URI of the subnetwork resource that this interface + belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. Changing this forces a new interface to be created. Only one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + vpnTunnel: Optional[str] = None + """ + The name or resource link to the VPN tunnel this + interface will be linked to. Changing this forces a new interface to be created. Only + one of vpn_tunnel, interconnect_attachment or subnetwork can be specified. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterInterface(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RouterInterface']] = 'RouterInterface' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterInterfaceSpec defines the desired state of RouterInterface + """ + status: Optional[Status] = None + """ + RouterInterfaceStatus defines the observed state of RouterInterface. + """ + + +class RouterInterfaceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterInterface] + """ + List of routerinterfaces. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/routernat/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/routernat/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/routernat/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/routernat/v1beta1.py new file mode 100644 index 000000000..648fd8b06 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/routernat/v1beta1.py @@ -0,0 +1,1009 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_routernat.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class LogConfig(BaseModel): + enable: Optional[bool] = None + """ + Indicates whether or not to export logs. + """ + filter: Optional[str] = None + """ + Specifies the desired filtering of logs on this NAT. + Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL. + """ + + +class Nat64SubnetworkItem(BaseModel): + name: Optional[str] = None + """ + Self-link of the subnetwork resource that will use NAT64 + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NatIpsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NatIpsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceNatActiveIpsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceNatActiveIpsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SourceNatActiveRangesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceNatActiveRangesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Action(BaseModel): + sourceNatActiveIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources used for this NAT rule. + These IP addresses must be valid static external IP addresses assigned to the project. + This field is used for public NAT. + """ + sourceNatActiveIpsRefs: Optional[List[SourceNatActiveIpsRef]] = None + """ + References to Address in compute to populate sourceNatActiveIps. + """ + sourceNatActiveIpsSelector: Optional[SourceNatActiveIpsSelector] = None + """ + Selector for a list of Address in compute to populate sourceNatActiveIps. + """ + sourceNatActiveRanges: Optional[List[str]] = None + """ + A list of URLs of the subnetworks used as source ranges for this NAT Rule. + These subnetworks must have purpose set to PRIVATE_NAT. + This field is used for private NAT. + """ + sourceNatActiveRangesRefs: Optional[List[SourceNatActiveRangesRef]] = None + """ + References to Subnetwork in compute to populate sourceNatActiveRanges. + """ + sourceNatActiveRangesSelector: Optional[SourceNatActiveRangesSelector] = None + """ + Selector for a list of Subnetwork in compute to populate sourceNatActiveRanges. + """ + sourceNatDrainIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. + These IPs must be valid static external IPs that have been assigned to the NAT. + These IPs should be used for updating/patching a NAT rule only. + This field is used for public NAT. + """ + sourceNatDrainRanges: Optional[List[str]] = None + """ + A list of URLs of subnetworks representing source ranges to be drained. + This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. + This field is used for private NAT. + """ + + +class Rule(BaseModel): + action: Optional[Action] = None + """ + The action to be enforced for traffic that matches this rule. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this rule. + """ + match: Optional[str] = None + """ + CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. + If it evaluates to true, the corresponding action is enforced. + The following examples are valid match expressions for public NAT: + "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" + "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" + The following example is a valid match expression for private NAT: + "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'" + """ + ruleNumber: Optional[float] = None + """ + An integer uniquely identifying a rule in the list. + The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT. + """ + + +class NameRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NameSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SubnetworkItem(BaseModel): + name: Optional[str] = None + """ + Self-link of subnetwork to NAT + """ + nameRef: Optional[NameRef] = None + """ + Reference to a Subnetwork in compute to populate name. + """ + nameSelector: Optional[NameSelector] = None + """ + Selector for a Subnetwork in compute to populate name. + """ + secondaryIpRangeNames: Optional[List[str]] = None + """ + List of the secondary ranges of the subnetwork that are allowed + to use NAT. This can be populated only if + LIST_OF_SECONDARY_IP_RANGES is one of the values in + sourceIpRangesToNat + """ + sourceIpRangesToNat: Optional[List[str]] = None + """ + List of options for which source IPs in the subnetwork + should have NAT enabled. Supported values include: + ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, + PRIMARY_IP_RANGE. + """ + + +class ForProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + initialNatIps: Optional[List[str]] = None + """ + Self-links of NAT IPs to be used as initial value for creation alongside a RouterNatAddress resource. + Conflicts with natIps and drainNatIps. Only valid if natIpAllocateOption is set to MANUAL_ONLY. + """ + logConfig: Optional[LogConfig] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + nat64Subnetwork: Optional[List[Nat64SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations whose traffic should be translated by NAT64 Gateway. + Only used if source_subnetwork_ip_ranges_to_nat64 is set to LIST_OF_IPV6_SUBNETWORKS + Structure is documented below. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + If this field is used alongside with a count created list of address resources google_compute_address.foobar.*.self_link, + the access level resource for the address resource must have a lifecycle block with create_before_destroy = true so + the number of resources can be increased/decreased without triggering the resourceInUseByAnotherResource error. + """ + natIpsRefs: Optional[List[NatIpsRef]] = None + """ + References to Address in compute to populate natIps. + """ + natIpsSelector: Optional[NatIpsSelector] = None + """ + Selector for a list of Address in compute to populate natIps. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + Region where the router and NAT reside. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this NAT will be configured. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + sourceSubnetworkIpRangesToNat64: Optional[str] = None + """ + Specify the Nat option for NAT64, which can take one of the following values: + ALL_IPV6_SUBNETWORKS: All of the IP ranges in every Subnetwork are allowed to Nat. + LIST_OF_IPV6_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field nat64Subnetwork below). + Note that if this field contains NAT64_ALL_V6_SUBNETWORKS no other Router.Nat section in this region can also enable NAT64 for any Subnetworks in this network. + Other Router.Nat sections can still be present to enable NAT44 only. + Possible values are: ALL_IPV6_SUBNETWORKS, LIST_OF_IPV6_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + type: Optional[str] = None + """ + Indicates whether this NAT is used for public or private IP translation. + If unspecified, it defaults to PUBLIC. + If PUBLIC NAT used for public IP translation. + If PRIVATE NAT used for private IP translation. + Default value is PUBLIC. + Possible values are: PUBLIC, PRIVATE. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class InitProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + initialNatIps: Optional[List[str]] = None + """ + Self-links of NAT IPs to be used as initial value for creation alongside a RouterNatAddress resource. + Conflicts with natIps and drainNatIps. Only valid if natIpAllocateOption is set to MANUAL_ONLY. + """ + logConfig: Optional[LogConfig] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + nat64Subnetwork: Optional[List[Nat64SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations whose traffic should be translated by NAT64 Gateway. + Only used if source_subnetwork_ip_ranges_to_nat64 is set to LIST_OF_IPV6_SUBNETWORKS + Structure is documented below. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + If this field is used alongside with a count created list of address resources google_compute_address.foobar.*.self_link, + the access level resource for the address resource must have a lifecycle block with create_before_destroy = true so + the number of resources can be increased/decreased without triggering the resourceInUseByAnotherResource error. + """ + natIpsRefs: Optional[List[NatIpsRef]] = None + """ + References to Address in compute to populate natIps. + """ + natIpsSelector: Optional[NatIpsSelector] = None + """ + Selector for a list of Address in compute to populate natIps. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + sourceSubnetworkIpRangesToNat64: Optional[str] = None + """ + Specify the Nat option for NAT64, which can take one of the following values: + ALL_IPV6_SUBNETWORKS: All of the IP ranges in every Subnetwork are allowed to Nat. + LIST_OF_IPV6_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field nat64Subnetwork below). + Note that if this field contains NAT64_ALL_V6_SUBNETWORKS no other Router.Nat section in this region can also enable NAT64 for any Subnetworks in this network. + Other Router.Nat sections can still be present to enable NAT44 only. + Possible values are: ALL_IPV6_SUBNETWORKS, LIST_OF_IPV6_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + type: Optional[str] = None + """ + Indicates whether this NAT is used for public or private IP translation. + If unspecified, it defaults to PUBLIC. + If PUBLIC NAT used for public IP translation. + If PRIVATE NAT used for private IP translation. + Default value is PUBLIC. + Possible values are: PUBLIC, PRIVATE. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ActionModel(BaseModel): + sourceNatActiveIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources used for this NAT rule. + These IP addresses must be valid static external IP addresses assigned to the project. + This field is used for public NAT. + """ + sourceNatActiveRanges: Optional[List[str]] = None + """ + A list of URLs of the subnetworks used as source ranges for this NAT Rule. + These subnetworks must have purpose set to PRIVATE_NAT. + This field is used for private NAT. + """ + sourceNatDrainIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. + These IPs must be valid static external IPs that have been assigned to the NAT. + These IPs should be used for updating/patching a NAT rule only. + This field is used for public NAT. + """ + sourceNatDrainRanges: Optional[List[str]] = None + """ + A list of URLs of subnetworks representing source ranges to be drained. + This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. + This field is used for private NAT. + """ + + +class SubnetworkItemModel(BaseModel): + name: Optional[str] = None + """ + Self-link of subnetwork to NAT + """ + secondaryIpRangeNames: Optional[List[str]] = None + """ + List of the secondary ranges of the subnetwork that are allowed + to use NAT. This can be populated only if + LIST_OF_SECONDARY_IP_RANGES is one of the values in + sourceIpRangesToNat + """ + sourceIpRangesToNat: Optional[List[str]] = None + """ + List of options for which source IPs in the subnetwork + should have NAT enabled. Supported values include: + ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, + PRIMARY_IP_RANGE. + """ + + +class AtProvider(BaseModel): + autoNetworkTier: Optional[str] = None + """ + The network tier to use when automatically reserving NAT IP addresses. + Must be one of: PREMIUM, STANDARD. If not specified, then the current + project-level default tier is used. + Possible values are: PREMIUM, STANDARD. + """ + drainNatIps: Optional[List[str]] = None + """ + A list of URLs of the IP resources to be drained. These IPs must be + valid static external IPs that have been assigned to the NAT. + """ + enableDynamicPortAllocation: Optional[bool] = None + """ + Enable Dynamic Port Allocation. + If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. + If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. + If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + Mutually exclusive with enableEndpointIndependentMapping. + """ + enableEndpointIndependentMapping: Optional[bool] = None + """ + Enable endpoint independent mapping. + For more information see the official documentation. + """ + endpointTypes: Optional[List[str]] = None + """ + Specifies the endpoint Types supported by the NAT Gateway. + Supported values include: + ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, + ENDPOINT_TYPE_MANAGED_PROXY_LB. + """ + icmpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{region}}/{{router}}/{{name}} + """ + initialNatIps: Optional[List[str]] = None + """ + Self-links of NAT IPs to be used as initial value for creation alongside a RouterNatAddress resource. + Conflicts with natIps and drainNatIps. Only valid if natIpAllocateOption is set to MANUAL_ONLY. + """ + logConfig: Optional[LogConfig] = None + """ + Configuration for logging on NAT + Structure is documented below. + """ + maxPortsPerVm: Optional[float] = None + """ + Maximum number of ports allocated to a VM from this NAT. + This field can only be set when enableDynamicPortAllocation is enabled. + """ + minPortsPerVm: Optional[float] = None + """ + Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set. + """ + nat64Subnetwork: Optional[List[Nat64SubnetworkItem]] = None + """ + One or more subnetwork NAT configurations whose traffic should be translated by NAT64 Gateway. + Only used if source_subnetwork_ip_ranges_to_nat64 is set to LIST_OF_IPV6_SUBNETWORKS + Structure is documented below. + """ + natIpAllocateOption: Optional[str] = None + """ + How external IPs should be allocated for this NAT. Valid values are + AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud + Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. + Possible values are: MANUAL_ONLY, AUTO_ONLY. + """ + natIps: Optional[List[str]] = None + """ + Self-links of NAT IPs. Only valid if natIpAllocateOption + is set to MANUAL_ONLY. + If this field is used alongside with a count created list of address resources google_compute_address.foobar.*.self_link, + the access level resource for the address resource must have a lifecycle block with create_before_destroy = true so + the number of resources can be increased/decreased without triggering the resourceInUseByAnotherResource error. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and NAT reside. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this NAT will be configured. + """ + rules: Optional[List[Rule]] = None + """ + A list of rules associated with this NAT. + Structure is documented below. + """ + sourceSubnetworkIpRangesToNat: Optional[str] = None + """ + How NAT should be configured per Subnetwork. + If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the + IP ranges in every Subnetwork are allowed to Nat. + If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP + ranges in every Subnetwork are allowed to Nat. + LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat + (specified in the field subnetwork below). Note that if this field + contains ALL_SUBNETWORKS_ALL_IP_RANGES or + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any + other RouterNat section in any Router for this network in this region. + Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS. + """ + sourceSubnetworkIpRangesToNat64: Optional[str] = None + """ + Specify the Nat option for NAT64, which can take one of the following values: + ALL_IPV6_SUBNETWORKS: All of the IP ranges in every Subnetwork are allowed to Nat. + LIST_OF_IPV6_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field nat64Subnetwork below). + Note that if this field contains NAT64_ALL_V6_SUBNETWORKS no other Router.Nat section in this region can also enable NAT64 for any Subnetworks in this network. + Other Router.Nat sections can still be present to enable NAT44 only. + Possible values are: ALL_IPV6_SUBNETWORKS, LIST_OF_IPV6_SUBNETWORKS. + """ + subnetwork: Optional[List[SubnetworkItemModel]] = None + """ + One or more subnetwork NAT configurations. Only used if + source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS + Structure is documented below. + """ + tcpEstablishedIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP established connections. + Defaults to 1200s if not set. + """ + tcpTimeWaitTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP connections that are in TIME_WAIT state. + Defaults to 120s if not set. + """ + tcpTransitoryIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for TCP transitory connections. + Defaults to 30s if not set. + """ + type: Optional[str] = None + """ + Indicates whether this NAT is used for public or private IP translation. + If unspecified, it defaults to PUBLIC. + If PUBLIC NAT used for public IP translation. + If PRIVATE NAT used for private IP translation. + Default value is PUBLIC. + Possible values are: PUBLIC, PRIVATE. + """ + udpIdleTimeoutSec: Optional[float] = None + """ + Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterNAT(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RouterNAT']] = 'RouterNAT' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterNATSpec defines the desired state of RouterNAT + """ + status: Optional[Status] = None + """ + RouterNATStatus defines the observed state of RouterNAT. + """ + + +class RouterNATList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterNAT] + """ + List of routernats. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/routerpeer/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/routerpeer/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/routerpeer/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/routerpeer/v1beta1.py new file mode 100644 index 000000000..5ac536daa --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/routerpeer/v1beta1.py @@ -0,0 +1,978 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_routerpeer.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class AdvertisedIpRange(BaseModel): + description: Optional[str] = None + """ + User-specified description for the IP range. + """ + range: Optional[str] = None + """ + The IP range to advertise. The value must be a + CIDR-formatted string. + """ + + +class Bfd(BaseModel): + minReceiveInterval: Optional[float] = None + """ + The minimum interval, in milliseconds, between BFD control packets + received from the peer router. The actual value is negotiated + between the two routers and is equal to the greater of this value + and the transmit interval of the other router. If set, this value + must be between 1000 and 30000. + """ + minTransmitInterval: Optional[float] = None + """ + The minimum interval, in milliseconds, between BFD control packets + transmitted to the peer router. The actual value is negotiated + between the two routers and is equal to the greater of this value + and the corresponding receive interval of the other router. If set, + this value must be between 1000 and 30000. + """ + multiplier: Optional[float] = None + """ + The number of consecutive BFD packets that must be missed before + BFD declares that a peer is unavailable. If set, the value must + be a value between 5 and 16. + """ + sessionInitializationMode: Optional[str] = None + """ + The BFD session initialization mode for this BGP peer. + If set to ACTIVE, the Cloud Router will initiate the BFD session + for this BGP peer. If set to PASSIVE, the Cloud Router will wait + for the peer router to initiate the BFD session for this BGP peer. + If set to DISABLED, BFD is disabled for this BGP peer. + Possible values are: ACTIVE, DISABLED, PASSIVE. + """ + + +class CustomLearnedIpRange(BaseModel): + range: Optional[str] = None + """ + The IP range to learn. The value must be a + CIDR-formatted string. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InterfaceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InterfaceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class KeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class Md5AuthenticationKey(BaseModel): + keySecretRef: Optional[KeySecretRef] = None + """ + The MD5 authentication key for this BGP peer. Maximum length is 80 characters. Can only contain printable ASCII characters + """ + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. Must comply with RFC1035. + """ + + +class PeerIpAddressRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeerIpAddressSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RegionRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RegionSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterApplianceInstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterApplianceInstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[Bfd] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + """ + The custom learned route IP address range. Must be a valid CIDR-formatted prefix. + If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, + a /32 singular IP address range, and, for IPv6, /128. + Structure is documented below. + """ + customLearnedRoutePriority: Optional[float] = None + """ + The user-defined custom learned route priority for a BGP session. + This value is applied to all custom learned route ranges for the session. + You can choose a value from 0 to 65335. If you don't provide a value, + Google Cloud assigns a priority of 100 to the ranges. + """ + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + interfaceRef: Optional[InterfaceRef] = None + """ + Reference to a RouterInterface in compute to populate interface. + """ + interfaceSelector: Optional[InterfaceSelector] = None + """ + Selector for a RouterInterface in compute to populate interface. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + md5AuthenticationKey: Optional[Md5AuthenticationKey] = None + """ + Configuration for MD5 authentication on the BGP session. + Structure is documented below. + """ + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpAddressRef: Optional[PeerIpAddressRef] = None + """ + Reference to a Address in compute to populate peerIpAddress. + """ + peerIpAddressSelector: Optional[PeerIpAddressSelector] = None + """ + Selector for a Address in compute to populate peerIpAddress. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a Router in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a Router in compute to populate region. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this BgpPeer will be configured. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + routerApplianceInstanceRef: Optional[RouterApplianceInstanceRef] = None + """ + Reference to a Instance in compute to populate routerApplianceInstance. + """ + routerApplianceInstanceSelector: Optional[RouterApplianceInstanceSelector] = None + """ + Selector for a Instance in compute to populate routerApplianceInstance. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class Md5AuthenticationKeyModel(BaseModel): + keySecretRef: KeySecretRef + """ + The MD5 authentication key for this BGP peer. Maximum length is 80 characters. Can only contain printable ASCII characters + """ + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. Must comply with RFC1035. + """ + + +class InitProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[Bfd] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + """ + The custom learned route IP address range. Must be a valid CIDR-formatted prefix. + If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, + a /32 singular IP address range, and, for IPv6, /128. + Structure is documented below. + """ + customLearnedRoutePriority: Optional[float] = None + """ + The user-defined custom learned route priority for a BGP session. + This value is applied to all custom learned route ranges for the session. + You can choose a value from 0 to 65335. If you don't provide a value, + Google Cloud assigns a priority of 100 to the ranges. + """ + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + interfaceRef: Optional[InterfaceRef] = None + """ + Reference to a RouterInterface in compute to populate interface. + """ + interfaceSelector: Optional[InterfaceSelector] = None + """ + Selector for a RouterInterface in compute to populate interface. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + md5AuthenticationKey: Optional[Md5AuthenticationKeyModel] = None + """ + Configuration for MD5 authentication on the BGP session. + Structure is documented below. + """ + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpAddressRef: Optional[PeerIpAddressRef] = None + """ + Reference to a Address in compute to populate peerIpAddress. + """ + peerIpAddressSelector: Optional[PeerIpAddressSelector] = None + """ + Selector for a Address in compute to populate peerIpAddress. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + regionRef: Optional[RegionRef] = None + """ + Reference to a Router in compute to populate region. + """ + regionSelector: Optional[RegionSelector] = None + """ + Selector for a Router in compute to populate region. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + routerApplianceInstanceRef: Optional[RouterApplianceInstanceRef] = None + """ + Reference to a Instance in compute to populate routerApplianceInstance. + """ + routerApplianceInstanceSelector: Optional[RouterApplianceInstanceSelector] = None + """ + Selector for a Instance in compute to populate routerApplianceInstance. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class Md5AuthenticationKeyModel1(BaseModel): + name: Optional[str] = None + """ + Name used to identify the key. Must be unique within a router. Must comply with RFC1035. + """ + + +class AtProvider(BaseModel): + advertiseMode: Optional[str] = None + """ + User-specified flag to indicate which mode to use for advertisement. + Valid values of this enum field are: DEFAULT, CUSTOM + Default value is DEFAULT. + Possible values are: DEFAULT, CUSTOM. + """ + advertisedGroups: Optional[List[str]] = None + """ + User-specified list of prefix groups to advertise in custom + mode, which currently supports the following option: + """ + advertisedIpRanges: Optional[List[AdvertisedIpRange]] = None + """ + User-specified list of individual IP ranges to advertise in + custom mode. This field can only be populated if advertiseMode + is CUSTOM and is advertised to all peers of the router. These IP + ranges will be advertised in addition to any specified groups. + Leave this field blank to advertise no custom IP ranges. + Structure is documented below. + """ + advertisedRoutePriority: Optional[float] = None + """ + The priority of routes advertised to this BGP peer. + Where there is more than one matching route of maximum + length, the routes with the lowest priority value win. + """ + bfd: Optional[Bfd] = None + """ + BFD configuration for the BGP peering. + Structure is documented below. + """ + customLearnedIpRanges: Optional[List[CustomLearnedIpRange]] = None + """ + The custom learned route IP address range. Must be a valid CIDR-formatted prefix. + If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, + a /32 singular IP address range, and, for IPv6, /128. + Structure is documented below. + """ + customLearnedRoutePriority: Optional[float] = None + """ + The user-defined custom learned route priority for a BGP session. + This value is applied to all custom learned route ranges for the session. + You can choose a value from 0 to 65335. If you don't provide a value, + Google Cloud assigns a priority of 100 to the ranges. + """ + enable: Optional[bool] = None + """ + The status of the BGP peer connection. If set to false, any active session + with the peer is terminated and all associated routing information is removed. + If set to true, the peer connection can be established with routing information. + The default is true. + """ + enableIpv4: Optional[bool] = None + """ + Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + """ + enableIpv6: Optional[bool] = None + """ + Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default. + """ + exportPolicies: Optional[List[str]] = None + """ + routers.list of export policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}} + """ + importPolicies: Optional[List[str]] = None + """ + routers.list of import policies applied to this peer, in the order they must be evaluated. + The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. + """ + interface: Optional[str] = None + """ + Name of the interface the BGP peer is associated with. + """ + ipAddress: Optional[str] = None + """ + IP address of the interface inside Google Cloud Platform. + Only IPv4 is supported. + """ + ipv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the interface inside Google Cloud Platform. + """ + ipv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the interface inside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + isAdvertisedRoutePrioritySet: Optional[bool] = None + isCustomLearnedPrioritySet: Optional[bool] = None + managementType: Optional[str] = None + """ + The resource that configures and manages this BGP peer. + """ + md5AuthenticationKey: Optional[Md5AuthenticationKeyModel1] = None + """ + Configuration for MD5 authentication on the BGP session. + Structure is documented below. + """ + peerAsn: Optional[float] = None + """ + Peer BGP Autonomous System Number (ASN). + Each BGP interface may use a different value. + """ + peerIpAddress: Optional[str] = None + """ + IP address of the BGP interface outside Google Cloud Platform. + Only IPv4 is supported. Required if ip_address is set. + """ + peerIpv4NexthopAddress: Optional[str] = None + """ + IPv4 address of the BGP interface outside Google Cloud Platform. + """ + peerIpv6NexthopAddress: Optional[str] = None + """ + IPv6 address of the BGP interface outside Google Cloud Platform. + The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. + If you do not specify the next hop addresses, Google Cloud automatically + assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Region where the router and BgpPeer reside. + If it is not provided, the provider region is used. + """ + router: Optional[str] = None + """ + The name of the Cloud Router in which this BgpPeer will be configured. + """ + routerApplianceInstance: Optional[str] = None + """ + The URI of the VM instance that is used as third-party router appliances + such as Next Gen Firewalls, Virtual Routers, or Router Appliances. + The VM instance must be located in zones contained in the same region as + this Cloud Router. The VM instance is the peer side of the BGP session. + """ + zeroAdvertisedRoutePriority: Optional[bool] = None + """ + The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. + This value has to be set true to force the advertised_route_priority to be 0. + """ + zeroCustomLearnedRoutePriority: Optional[bool] = None + """ + The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. + This value has to be set true to force the custom_learned_route_priority to be 0. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class RouterPeer(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['RouterPeer']] = 'RouterPeer' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RouterPeerSpec defines the desired state of RouterPeer + """ + status: Optional[Status] = None + """ + RouterPeerStatus defines the observed state of RouterPeer. + """ + + +class RouterPeerList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[RouterPeer] + """ + List of routerpeers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/securitypolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/securitypolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/securitypolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/securitypolicy/v1beta1.py new file mode 100644 index 000000000..9fa94fe0e --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/securitypolicy/v1beta1.py @@ -0,0 +1,691 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_securitypolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class TrafficGranularityConfig(BaseModel): + enableEachUniqueValue: Optional[bool] = None + """ + If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if value is empty. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class ThresholdConfig(BaseModel): + autoDeployConfidenceThreshold: Optional[float] = None + """ + Confidence threshold above which Adaptive Protection's auto-deploy takes actions. + """ + autoDeployExpirationSec: Optional[float] = None + """ + Duration over which Adaptive Protection's auto-deployed actions last. + """ + autoDeployImpactedBaselineThreshold: Optional[float] = None + """ + Impacted baseline threshold below which Adaptive Protection's auto-deploy takes actions. + """ + autoDeployLoadThreshold: Optional[float] = None + """ + Load threshold above which Adaptive Protection automatically deploy threshold based on the backend load threshold and detect a new rule during an alerted attack. + """ + detectionAbsoluteQps: Optional[float] = None + """ + Detection threshold based on absolute QPS. + """ + detectionLoadThreshold: Optional[float] = None + """ + Detection threshold based on the backend service's load. + """ + detectionRelativeToBaselineQps: Optional[float] = None + """ + Detection threshold based on QPS relative to the average of baseline traffic. + """ + name: Optional[str] = None + """ + The name of config. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + """ + trafficGranularityConfigs: Optional[List[TrafficGranularityConfig]] = None + """ + Configuration options for enabling Adaptive Protection to work on the specified service granularity. Structure is documented below. + """ + + +class Layer7DdosDefenseConfig(BaseModel): + enable: Optional[bool] = None + """ + If set to true, enables CAAP for L7 DDoS detection. + """ + ruleVisibility: Optional[str] = None + """ + Rule visibility can be one of the following: + """ + thresholdConfigs: Optional[List[ThresholdConfig]] = None + """ + Configuration options for layer7 adaptive protection for various customizable thresholds. Structure is documented below. + """ + + +class AdaptiveProtectionConfig(BaseModel): + layer7DdosDefenseConfig: Optional[Layer7DdosDefenseConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection Layer 7 DDoS Defense. Structure is documented below. + """ + + +class JsonCustomConfig(BaseModel): + contentTypes: Optional[List[str]] = None + """ + A list of custom Content-Type header values to apply the JSON parsing. The + format of the Content-Type header values is defined in + RFC 1341. When configuring a custom Content-Type header + value, only the type/subtype needs to be specified, and the parameters should be excluded. + """ + + +class AdvancedOptionsConfig(BaseModel): + jsonCustomConfig: Optional[JsonCustomConfig] = None + """ + Custom configuration to apply the JSON parsing. Only applicable when + json_parsing is set to STANDARD. Structure is documented below. + """ + jsonParsing: Optional[str] = None + """ + Whether or not to JSON parse the payload body. Defaults to DISABLED. + """ + logLevel: Optional[str] = None + """ + Log level to use. Defaults to NORMAL. + """ + userIpRequestHeaders: Optional[List[str]] = None + """ + An optional list of case-insensitive request header names to use for resolving the callers client IP address. + """ + + +class RecaptchaOptionsConfig(BaseModel): + redirectSiteKey: Optional[str] = None + """ + A field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. + """ + + +class RequestHeadersToAdd(BaseModel): + headerName: Optional[str] = None + """ + The name of the header to set. + """ + headerValue: Optional[str] = None + """ + The value to set the named header to. + """ + + +class HeaderAction(BaseModel): + requestHeadersToAdds: Optional[List[RequestHeadersToAdd]] = None + """ + The list of request headers to add or overwrite if they're already present. Structure is documented below. + """ + + +class Config(BaseModel): + srcIpRanges: Optional[List[str]] = None + """ + Set of IP addresses or ranges (IPV4 or IPV6) in CIDR notation + to match against inbound traffic. There is a limit of 10 IP ranges per rule. A value of * matches all IPs + (can be used to override the default behavior). + """ + + +class Expr(BaseModel): + expression: Optional[str] = None + """ + Textual representation of an expression in Common Expression Language syntax. + The application context of the containing message determines which well-known feature set of CEL is supported. + """ + + +class RecaptchaOptions(BaseModel): + actionTokenSiteKeys: Optional[List[str]] = None + """ + A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + """ + sessionTokenSiteKeys: Optional[List[str]] = None + """ + A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + """ + + +class ExprOptions(BaseModel): + recaptchaOptions: Optional[RecaptchaOptions] = None + """ + reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect. + Structure is documented below. + """ + + +class Match(BaseModel): + config: Optional[Config] = None + """ + The configuration options available when specifying versioned_expr. + This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + Structure is documented below. + """ + expr: Optional[Expr] = None + """ + User defined CEVAL expression. A CEVAL expression is used to specify match criteria + such as origin.ip, source.region_code and contents in the request header. + Structure is documented below. + """ + exprOptions: Optional[ExprOptions] = None + """ + The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr'). + Structure is documented below. + """ + versionedExpr: Optional[str] = None + """ + Predefined rule expression. If this field is specified, config must also be specified. + Available options: + """ + + +class RequestCookieItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestHeaderItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestQueryParamItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class RequestUriItem(BaseModel): + operator: Optional[str] = None + """ + You can specify an exact match or a partial match by using a field operator and a field value. + """ + value: Optional[str] = None + """ + Requests that match this value constitute a granular traffic unit. + """ + + +class ExclusionItem(BaseModel): + requestCookie: Optional[List[RequestCookieItem]] = None + """ + Request cookie whose value will be excluded from inspection during preconfigured WAF evaluation. Structure is documented below. + """ + requestHeader: Optional[List[RequestHeaderItem]] = None + """ + Request header whose value will be excluded from inspection during preconfigured WAF evaluation. Structure is documented below. + """ + requestQueryParam: Optional[List[RequestQueryParamItem]] = None + """ + Request query parameter whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body. Structure is documented below. + """ + requestUri: Optional[List[RequestUriItem]] = None + """ + Request URI from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded. Structure is documented below. + """ + targetRuleIds: Optional[List[str]] = None + """ + A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set. + """ + targetRuleSet: Optional[str] = None + """ + Target WAF rule set to apply the preconfigured WAF exclusion. + """ + + +class PreconfiguredWafConfig(BaseModel): + exclusion: Optional[List[ExclusionItem]] = None + """ + An exclusion to apply during preconfigured WAF evaluation. Structure is documented below. + """ + + +class BanThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class EnforceOnKeyConfig(BaseModel): + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + """ + enforceOnKeyType: Optional[str] = None + """ + Determines the key to enforce the rate_limit_threshold on. If not specified, defaults to ALL. + """ + + +class ExceedRedirectOptions(BaseModel): + target: Optional[str] = None + """ + External redirection target when EXTERNAL_302 is set in type. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class RateLimitThreshold(BaseModel): + count: Optional[float] = None + """ + Number of HTTP(S) requests for calculating the threshold. + """ + intervalSec: Optional[float] = None + """ + Interval over which the threshold is computed. + """ + + +class RateLimitOptions(BaseModel): + banDurationSec: Optional[float] = None + """ + Can only be specified if the action for the rule is rate_based_ban. + If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + """ + banThreshold: Optional[BanThreshold] = None + """ + Can only be specified if the action for the rule is rate_based_ban. + If specified, the key will be banned for the configured ban_duration_sec when the number of requests that exceed the rate_limit_threshold also + exceed this ban_threshold. Structure is documented below. + """ + conformAction: Optional[str] = None + """ + Action to take for requests that are under the configured rate limit threshold. Valid option is allow only. + """ + enforceOnKey: Optional[str] = None + """ + Determines the key to enforce the rate_limit_threshold on. If not specified, defaults to ALL. + """ + enforceOnKeyConfigs: Optional[List[EnforceOnKeyConfig]] = None + """ + If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which rate limit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must be set to an empty string. Structure is documented below. + """ + enforceOnKeyName: Optional[str] = None + """ + Rate limit key name applicable only for the following key types: + """ + exceedAction: Optional[str] = None + """ + When a request is denied, returns the HTTP response code specified. + Valid options are deny() where valid values for status are 403, 404, 429, and 502. + """ + exceedRedirectOptions: Optional[ExceedRedirectOptions] = None + """ + Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. Structure is documented below. + """ + rateLimitThreshold: Optional[RateLimitThreshold] = None + """ + Threshold at which to begin ratelimiting. Structure is documented below. + """ + + +class RedirectOptions(BaseModel): + target: Optional[str] = None + """ + External redirection target when EXTERNAL_302 is set in type. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class RuleItem(BaseModel): + action: Optional[str] = None + """ + Action to take when match matches the request. Valid values: + """ + description: Optional[str] = None + """ + An optional description of this rule. Max size is 64. + """ + headerAction: Optional[HeaderAction] = None + """ + Additional actions that are performed on headers. Structure is documented below. + """ + match: Optional[Match] = None + """ + A match condition that incoming traffic is evaluated against. + If it evaluates to true, the corresponding action is enforced. Structure is documented below. + """ + preconfiguredWafConfig: Optional[PreconfiguredWafConfig] = None + """ + Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. Structure is documented below. + """ + preview: Optional[bool] = None + """ + When set to true, the action specified above is not enforced. + Stackdriver logs for requests that trigger a preview action are annotated as such. + """ + priority: Optional[float] = None + """ + An unique positive integer indicating the priority of evaluation for a rule. + Rules are evaluated from highest priority (lowest numerically) to lowest priority (highest numerically) in order. + """ + rateLimitOptions: Optional[RateLimitOptions] = None + """ + Must be specified if the action is rate_based_ban or throttle. Cannot be specified for other actions. Structure is documented below. + """ + redirectOptions: Optional[RedirectOptions] = None + """ + Can be specified if the action is redirect. Cannot be specified for other actions. Structure is documented below. + """ + + +class ForProvider(BaseModel): + adaptiveProtectionConfig: Optional[AdaptiveProtectionConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[AdvancedOptionsConfig] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[RecaptchaOptionsConfig] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class InitProvider(BaseModel): + adaptiveProtectionConfig: Optional[AdaptiveProtectionConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[AdvancedOptionsConfig] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[RecaptchaOptionsConfig] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + adaptiveProtectionConfig: Optional[AdaptiveProtectionConfig] = None + """ + Configuration for Google Cloud Armor Adaptive Protection. Structure is documented below. + """ + advancedOptionsConfig: Optional[AdvancedOptionsConfig] = None + """ + Advanced Configuration Options. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this security policy. Max size is 2048. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/securityPolicies/{{name}} + """ + project: Optional[str] = None + """ + The project in which the resource belongs. If it + is not provided, the provider project is used. + """ + recaptchaOptionsConfig: Optional[RecaptchaOptionsConfig] = None + """ + reCAPTCHA Configuration Options. Structure is documented below. + """ + rule: Optional[List[RuleItem]] = None + """ + The set of rules that belong to this policy. There must always be a default + rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a + security policy, a default rule with action "allow" will be added. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + type: Optional[str] = None + """ + The type indicates the intended use of the security policy. This field can be set only at resource creation time. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SecurityPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['SecurityPolicy']] = 'SecurityPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SecurityPolicySpec defines the desired state of SecurityPolicy + """ + status: Optional[Status] = None + """ + SecurityPolicyStatus defines the observed state of SecurityPolicy. + """ + + +class SecurityPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SecurityPolicy] + """ + List of securitypolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/serviceattachment/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/serviceattachment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/serviceattachment/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/serviceattachment/v1beta1.py new file mode 100644 index 000000000..98a7b243c --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/serviceattachment/v1beta1.py @@ -0,0 +1,628 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_serviceattachment.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkUrlRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkUrlSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ConsumerAcceptList(BaseModel): + connectionLimit: Optional[float] = None + """ + The number of consumer forwarding rules the consumer project can + create. + """ + networkUrl: Optional[str] = None + """ + The network that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + networkUrlRef: Optional[NetworkUrlRef] = None + """ + Reference to a Network in compute to populate networkUrl. + """ + networkUrlSelector: Optional[NetworkUrlSelector] = None + """ + Selector for a Network in compute to populate networkUrl. + """ + projectIdOrNum: Optional[str] = None + """ + A project that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + + +class NatSubnetsRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NatSubnetsSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class TargetServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + connectionPreference: Optional[str] = None + """ + The connection preference to use for this service attachment. Valid + values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL". + """ + consumerAcceptLists: Optional[List[ConsumerAcceptList]] = None + """ + An array of projects that are allowed to connect to this service + attachment. + Structure is documented below. + """ + consumerRejectLists: Optional[List[str]] = None + """ + An array of projects that are not allowed to connect to this service + attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + domainNames: Optional[List[str]] = None + """ + If specified, the domain name will be used during the integration between + the PSC connected endpoints and the Cloud DNS. For example, this is a + valid domain name: "p.mycompany.com.". Current max number of domain names + supported is 1. + """ + enableProxyProtocol: Optional[bool] = None + """ + If true, enable the proxy protocol which is for supplying client TCP/IP + address data in TCP connections that traverse proxies on their way to + destination servers. + """ + natSubnets: Optional[List[str]] = None + """ + An array of subnets that is provided for NAT in this service attachment. + """ + natSubnetsRefs: Optional[List[NatSubnetsRef]] = None + """ + References to Subnetwork in compute to populate natSubnets. + """ + natSubnetsSelector: Optional[NatSubnetsSelector] = None + """ + Selector for a list of Subnetwork in compute to populate natSubnets. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + propagatedConnectionLimit: Optional[float] = None + """ + The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. + This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. + If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. + If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. + If unspecified, the default propagated connection limit is 250. To explicitly send a zero value, set send_propagated_connection_limit_if_zero = true. + """ + reconcileConnections: Optional[bool] = None + """ + This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. + If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . + If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. + """ + region: str + """ + URL of the region where the resource resides. + """ + sendPropagatedConnectionLimitIfZero: Optional[bool] = None + """ + Controls the behavior of propagated_connection_limit. + When false, setting propagated_connection_limit to zero causes the provider to use to the API's default value. + When true, the provider will set propagated_connection_limit to zero. + Defaults to false. + """ + targetService: Optional[str] = None + """ + The URL of a service serving the endpoint identified by this service attachment. + """ + targetServiceRef: Optional[TargetServiceRef] = None + """ + Reference to a ForwardingRule in compute to populate targetService. + """ + targetServiceSelector: Optional[TargetServiceSelector] = None + """ + Selector for a ForwardingRule in compute to populate targetService. + """ + + +class InitProvider(BaseModel): + connectionPreference: Optional[str] = None + """ + The connection preference to use for this service attachment. Valid + values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL". + """ + consumerAcceptLists: Optional[List[ConsumerAcceptList]] = None + """ + An array of projects that are allowed to connect to this service + attachment. + Structure is documented below. + """ + consumerRejectLists: Optional[List[str]] = None + """ + An array of projects that are not allowed to connect to this service + attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + domainNames: Optional[List[str]] = None + """ + If specified, the domain name will be used during the integration between + the PSC connected endpoints and the Cloud DNS. For example, this is a + valid domain name: "p.mycompany.com.". Current max number of domain names + supported is 1. + """ + enableProxyProtocol: Optional[bool] = None + """ + If true, enable the proxy protocol which is for supplying client TCP/IP + address data in TCP connections that traverse proxies on their way to + destination servers. + """ + natSubnets: Optional[List[str]] = None + """ + An array of subnets that is provided for NAT in this service attachment. + """ + natSubnetsRefs: Optional[List[NatSubnetsRef]] = None + """ + References to Subnetwork in compute to populate natSubnets. + """ + natSubnetsSelector: Optional[NatSubnetsSelector] = None + """ + Selector for a list of Subnetwork in compute to populate natSubnets. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + propagatedConnectionLimit: Optional[float] = None + """ + The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. + This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. + If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. + If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. + If unspecified, the default propagated connection limit is 250. To explicitly send a zero value, set send_propagated_connection_limit_if_zero = true. + """ + reconcileConnections: Optional[bool] = None + """ + This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. + If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . + If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. + """ + sendPropagatedConnectionLimitIfZero: Optional[bool] = None + """ + Controls the behavior of propagated_connection_limit. + When false, setting propagated_connection_limit to zero causes the provider to use to the API's default value. + When true, the provider will set propagated_connection_limit to zero. + Defaults to false. + """ + targetService: Optional[str] = None + """ + The URL of a service serving the endpoint identified by this service attachment. + """ + targetServiceRef: Optional[TargetServiceRef] = None + """ + Reference to a ForwardingRule in compute to populate targetService. + """ + targetServiceSelector: Optional[TargetServiceSelector] = None + """ + Selector for a ForwardingRule in compute to populate targetService. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class ConnectedEndpoint(BaseModel): + consumerNetwork: Optional[str] = None + """ + (Output) + The url of the consumer network. + """ + endpoint: Optional[str] = None + """ + (Output) + The URL of the consumer forwarding rule. + """ + propagatedConnectionCount: Optional[float] = None + """ + (Output) + The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to. + """ + pscConnectionId: Optional[str] = None + """ + (Output) + The PSC connection id of the connected endpoint. + """ + status: Optional[str] = None + """ + (Output) + The status of the connection from the consumer forwarding rule to + this service attachment. + """ + + +class ConsumerAcceptListModel(BaseModel): + connectionLimit: Optional[float] = None + """ + The number of consumer forwarding rules the consumer project can + create. + """ + networkUrl: Optional[str] = None + """ + The network that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + projectIdOrNum: Optional[str] = None + """ + A project that is allowed to connect to this service attachment. + Only one of project_id_or_num and network_url may be set. + """ + + +class AtProvider(BaseModel): + connectedEndpoints: Optional[List[ConnectedEndpoint]] = None + """ + An array of the consumer forwarding rules connected to this service + attachment. + Structure is documented below. + """ + connectionPreference: Optional[str] = None + """ + The connection preference to use for this service attachment. Valid + values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL". + """ + consumerAcceptLists: Optional[List[ConsumerAcceptListModel]] = None + """ + An array of projects that are allowed to connect to this service + attachment. + Structure is documented below. + """ + consumerRejectLists: Optional[List[str]] = None + """ + An array of projects that are not allowed to connect to this service + attachment. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + domainNames: Optional[List[str]] = None + """ + If specified, the domain name will be used during the integration between + the PSC connected endpoints and the Cloud DNS. For example, this is a + valid domain name: "p.mycompany.com.". Current max number of domain names + supported is 1. + """ + enableProxyProtocol: Optional[bool] = None + """ + If true, enable the proxy protocol which is for supplying client TCP/IP + address data in TCP connections that traverse proxies on their way to + destination servers. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. This field is used internally during + updates of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/serviceAttachments/{{name}} + """ + natSubnets: Optional[List[str]] = None + """ + An array of subnets that is provided for NAT in this service attachment. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + propagatedConnectionLimit: Optional[float] = None + """ + The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. + This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. + If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. + If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. + If unspecified, the default propagated connection limit is 250. To explicitly send a zero value, set send_propagated_connection_limit_if_zero = true. + """ + reconcileConnections: Optional[bool] = None + """ + This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. + If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . + If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. + """ + region: Optional[str] = None + """ + URL of the region where the resource resides. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sendPropagatedConnectionLimitIfZero: Optional[bool] = None + """ + Controls the behavior of propagated_connection_limit. + When false, setting propagated_connection_limit to zero causes the provider to use to the API's default value. + When true, the provider will set propagated_connection_limit to zero. + Defaults to false. + """ + targetService: Optional[str] = None + """ + The URL of a service serving the endpoint identified by this service attachment. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class ServiceAttachment(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['ServiceAttachment']] = 'ServiceAttachment' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ServiceAttachmentSpec defines the desired state of ServiceAttachment + """ + status: Optional[Status] = None + """ + ServiceAttachmentStatus defines the observed state of ServiceAttachment. + """ + + +class ServiceAttachmentList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ServiceAttachment] + """ + List of serviceattachments. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sharedvpchostproject/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/sharedvpchostproject/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sharedvpchostproject/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/sharedvpchostproject/v1beta1.py new file mode 100644 index 000000000..12edfb0c1 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/sharedvpchostproject/v1beta1.py @@ -0,0 +1,257 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_sharedvpchostproject.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + project: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC host project + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class InitProvider(BaseModel): + project: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC host project + """ + projectRef: Optional[ProjectRef] = None + """ + Reference to a Project in cloudplatform to populate project. + """ + projectSelector: Optional[ProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate project. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + id: Optional[str] = None + """ + an identifier for the resource with format {{project}} + """ + project: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC host project + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SharedVPCHostProject(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['SharedVPCHostProject']] = 'SharedVPCHostProject' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SharedVPCHostProjectSpec defines the desired state of SharedVPCHostProject + """ + status: Optional[Status] = None + """ + SharedVPCHostProjectStatus defines the observed state of SharedVPCHostProject. + """ + + +class SharedVPCHostProjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SharedVPCHostProject] + """ + List of sharedvpchostprojects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sharedvpcserviceproject/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/sharedvpcserviceproject/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sharedvpcserviceproject/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/sharedvpcserviceproject/v1beta1.py new file mode 100644 index 000000000..41beb08e9 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/sharedvpcserviceproject/v1beta1.py @@ -0,0 +1,332 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_sharedvpcserviceproject.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HostProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HostProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ServiceProjectRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceProjectSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + deletionPolicy: Optional[str] = None + """ + The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON". + """ + hostProject: Optional[str] = None + """ + The ID of a host project to associate. + """ + hostProjectRef: Optional[HostProjectRef] = None + """ + Reference to a Project in cloudplatform to populate hostProject. + """ + hostProjectSelector: Optional[HostProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate hostProject. + """ + serviceProject: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC service project. + """ + serviceProjectRef: Optional[ServiceProjectRef] = None + """ + Reference to a Project in cloudplatform to populate serviceProject. + """ + serviceProjectSelector: Optional[ServiceProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate serviceProject. + """ + + +class InitProvider(BaseModel): + deletionPolicy: Optional[str] = None + """ + The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON". + """ + hostProject: Optional[str] = None + """ + The ID of a host project to associate. + """ + hostProjectRef: Optional[HostProjectRef] = None + """ + Reference to a Project in cloudplatform to populate hostProject. + """ + hostProjectSelector: Optional[HostProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate hostProject. + """ + serviceProject: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC service project. + """ + serviceProjectRef: Optional[ServiceProjectRef] = None + """ + Reference to a Project in cloudplatform to populate serviceProject. + """ + serviceProjectSelector: Optional[ServiceProjectSelector] = None + """ + Selector for a Project in cloudplatform to populate serviceProject. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + deletionPolicy: Optional[str] = None + """ + The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON". + """ + hostProject: Optional[str] = None + """ + The ID of a host project to associate. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{host_project}}/{{service_project}} + """ + serviceProject: Optional[str] = None + """ + The ID of the project that will serve as a Shared VPC service project. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SharedVPCServiceProject(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['SharedVPCServiceProject']] = 'SharedVPCServiceProject' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SharedVPCServiceProjectSpec defines the desired state of SharedVPCServiceProject + """ + status: Optional[Status] = None + """ + SharedVPCServiceProjectStatus defines the observed state of SharedVPCServiceProject. + """ + + +class SharedVPCServiceProjectList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SharedVPCServiceProject] + """ + List of sharedvpcserviceprojects. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/snapshot/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/snapshot/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/snapshot/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/snapshot/v1beta1.py new file mode 100644 index 000000000..1b1975983 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/snapshot/v1beta1.py @@ -0,0 +1,550 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_snapshot.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class RawKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class RsaEncryptedKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class SnapshotEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an encryption key stored in Google Cloud KMS, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class SourceDiskEncryptionKey(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + rawKeySecretRef: Optional[RawKeySecretRef] = None + """ + Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + rsaEncryptedKeySecretRef: Optional[RsaEncryptedKeySecretRef] = None + """ + Specifies an encryption key stored in Google Cloud KMS, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + Note: This property is sensitive and will not be displayed in the plan. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SourceDiskRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SourceDiskSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotEncryptionKey: Optional[SnapshotEncryptionKey] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class InitProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + snapshotEncryptionKey: Optional[SnapshotEncryptionKey] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKey] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + sourceDiskRef: Optional[SourceDiskRef] = None + """ + Reference to a Disk in compute to populate sourceDisk. + """ + sourceDiskSelector: Optional[SourceDiskSelector] = None + """ + Selector for a Disk in compute to populate sourceDisk. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class SnapshotEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + sha256: Optional[str] = None + """ + (Output) + The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied + encryption key that protects this resource. + """ + + +class SourceDiskEncryptionKeyModel(BaseModel): + kmsKeySelfLink: Optional[str] = None + """ + The name of the encryption key that is stored in Google Cloud KMS. + """ + kmsKeyServiceAccount: Optional[str] = None + """ + The service account used for the encryption request for the given KMS key. + If absent, the Compute Engine Service Agent service account is used. + """ + + +class AtProvider(BaseModel): + chainName: Optional[str] = None + """ + Creates the new snapshot in the snapshot chain labeled with the + specified name. The chain name must be 1-63 characters long and + comply with RFC1035. This is an uncommon option only for advanced + service owners who needs to create separate snapshot chains, for + example, for chargeback tracking. When you describe your snapshot + resource, this field is visible only if it has a non-empty value. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + diskSizeGb: Optional[float] = None + """ + Size of the snapshot, specified in GB. + """ + effectiveLabels: Optional[Dict[str, str]] = None + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/snapshots/{{name}} + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this Snapshot. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + licenses: Optional[List[str]] = None + """ + A list of public visible licenses that apply to this snapshot. This + can be because the original image had licenses attached (such as a + Windows image). snapshotEncryptionKey nested object Encrypts the + snapshot using a customer-supplied encryption key. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + snapshotEncryptionKey: Optional[SnapshotEncryptionKeyModel] = None + """ + Encrypts the snapshot using a customer-supplied encryption key. + After you encrypt a snapshot using a customer-supplied key, you must + provide the same key if you use the snapshot later. For example, you + must provide the encryption key when you create a disk from the + encrypted snapshot in a future request. + Customer-supplied encryption keys do not protect access to metadata of + the snapshot. + If you do not provide an encryption key when creating the snapshot, + then the snapshot will be encrypted using an automatically generated + key and you do not need to provide a key to use the snapshot later. + Structure is documented below. + """ + snapshotId: Optional[float] = None + """ + The unique identifier for the resource. + """ + sourceDisk: Optional[str] = None + """ + A reference to the disk used to create this snapshot. + """ + sourceDiskEncryptionKey: Optional[SourceDiskEncryptionKeyModel] = None + """ + The customer-supplied encryption key of the source snapshot. Required + if the source snapshot is protected by a customer-supplied encryption + key. + Structure is documented below. + """ + storageBytes: Optional[float] = None + """ + A size of the storage used by the snapshot. As snapshots share + storage, this number is expected to change with snapshot + creation/deletion. + """ + storageLocations: Optional[List[str]] = None + """ + Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + zone: Optional[str] = None + """ + A reference to the zone where the disk is hosted. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Snapshot(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Snapshot']] = 'Snapshot' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SnapshotSpec defines the desired state of Snapshot + """ + status: Optional[Status] = None + """ + SnapshotStatus defines the observed state of Snapshot. + """ + + +class SnapshotList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Snapshot] + """ + List of snapshots. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/snapshotiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/snapshotiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/snapshotiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/snapshotiammember/v1beta1.py new file mode 100644 index 000000000..f8eaf0e3d --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/snapshotiammember/v1beta1.py @@ -0,0 +1,196 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_snapshotiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + name: Optional[str] = None + project: Optional[str] = None + role: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SnapshotIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['SnapshotIAMMember']] = 'SnapshotIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SnapshotIAMMemberSpec defines the desired state of SnapshotIAMMember + """ + status: Optional[Status] = None + """ + SnapshotIAMMemberStatus defines the observed state of SnapshotIAMMember. + """ + + +class SnapshotIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SnapshotIAMMember] + """ + List of snapshotiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sslcertificate/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/sslcertificate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sslcertificate/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/sslcertificate/v1beta1.py new file mode 100644 index 000000000..cc6025045 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/sslcertificate/v1beta1.py @@ -0,0 +1,260 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_sslcertificate.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CertificateSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class PrivateKeySecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class ForProvider(BaseModel): + certificateSecretRef: Optional[CertificateSecretRef] = None + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: Optional[PrivateKeySecretRef] = None + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + certificateSecretRef: CertificateSecretRef + """ + The certificate in PEM format. + The certificate chain must be no greater than 5 certs long. + The chain must include at least one intermediate cert. + Note: This property is sensitive and will not be displayed in the plan. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + privateKeySecretRef: PrivateKeySecretRef + """ + The write-only private key in PEM format. + Note: This property is sensitive and will not be displayed in the plan. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateId: Optional[float] = None + """ + The unique identifier for the resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + expireTime: Optional[str] = None + """ + Expire time of the certificate in RFC3339 text format. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/sslCertificates/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SSLCertificate(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['SSLCertificate']] = 'SSLCertificate' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SSLCertificateSpec defines the desired state of SSLCertificate + """ + status: Optional[Status] = None + """ + SSLCertificateStatus defines the observed state of SSLCertificate. + """ + + +class SSLCertificateList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SSLCertificate] + """ + List of sslcertificates. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sslpolicy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/sslpolicy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/sslpolicy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/sslpolicy/v1beta1.py new file mode 100644 index 000000000..a8aa437d0 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/sslpolicy/v1beta1.py @@ -0,0 +1,314 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_sslpolicy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + customFeatures: Optional[List[str]] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. This can be one of + COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for which ciphers are available to use. Note: this argument + must be present when using the CUSTOM profile. This argument + must not be present when using any other profile. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + minTlsVersion: Optional[str] = None + """ + The minimum version of SSL protocol that can be used by the clients + to establish a connection with the load balancer. + Default value is TLS_1_0. + Possible values are: TLS_1_0, TLS_1_1, TLS_1_2. + """ + profile: Optional[str] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for information on what cipher suites each profile provides. If + CUSTOM is used, the custom_features attribute must be set. + Default value is COMPATIBLE. + Possible values are: COMPATIBLE, MODERN, RESTRICTED, CUSTOM. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + customFeatures: Optional[List[str]] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. This can be one of + COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for which ciphers are available to use. Note: this argument + must be present when using the CUSTOM profile. This argument + must not be present when using any other profile. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + minTlsVersion: Optional[str] = None + """ + The minimum version of SSL protocol that can be used by the clients + to establish a connection with the load balancer. + Default value is TLS_1_0. + Possible values are: TLS_1_0, TLS_1_1, TLS_1_2. + """ + profile: Optional[str] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for information on what cipher suites each profile provides. If + CUSTOM is used, the custom_features attribute must be set. + Default value is COMPATIBLE. + Possible values are: COMPATIBLE, MODERN, RESTRICTED, CUSTOM. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + customFeatures: Optional[List[str]] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. This can be one of + COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for which ciphers are available to use. Note: this argument + must be present when using the CUSTOM profile. This argument + must not be present when using any other profile. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + enabledFeatures: Optional[List[str]] = None + """ + The list of features enabled in the SSL policy. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this + object. This field is used in optimistic locking. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/sslPolicies/{{name}} + """ + minTlsVersion: Optional[str] = None + """ + The minimum version of SSL protocol that can be used by the clients + to establish a connection with the load balancer. + Default value is TLS_1_0. + Possible values are: TLS_1_0, TLS_1_1, TLS_1_2. + """ + profile: Optional[str] = None + """ + Profile specifies the set of SSL features that can be used by the + load balancer when negotiating SSL with clients. If using CUSTOM, + the set of SSL features to enable must be specified in the + customFeatures field. + See the official documentation + for information on what cipher suites each profile provides. If + CUSTOM is used, the custom_features attribute must be set. + Default value is COMPATIBLE. + Possible values are: COMPATIBLE, MODERN, RESTRICTED, CUSTOM. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SSLPolicy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['SSLPolicy']] = 'SSLPolicy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SSLPolicySpec defines the desired state of SSLPolicy + """ + status: Optional[Status] = None + """ + SSLPolicyStatus defines the observed state of SSLPolicy. + """ + + +class SSLPolicyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SSLPolicy] + """ + List of sslpolicies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/subnetwork/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/subnetwork/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/subnetwork/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/subnetwork/v1beta1.py new file mode 100644 index 000000000..977466dc7 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/subnetwork/v1beta1.py @@ -0,0 +1,733 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_subnetwork.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class LogConfig(BaseModel): + aggregationInterval: Optional[str] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + Toggles the aggregation interval for collecting flow logs. Increasing the + interval time will reduce the amount of generated flow logs for long + lasting connections. Default is an interval of 5 seconds per connection. + Default value is INTERVAL_5_SEC. + Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN. + """ + filterExpr: Optional[str] = None + """ + Export filter used to define which VPC flow logs should be logged, as as CEL expression. See + https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. + The default value is 'true', which evaluates to include everything. + """ + flowSampling: Optional[float] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + The value of the field must be in [0, 1]. Set the sampling rate of VPC + flow logs within the subnetwork where 1.0 means all collected logs are + reported and 0.0 means no logs are reported. Default is 0.5 which means + half of all collected logs are reported. + """ + metadata: Optional[str] = None + """ + Can only be specified if VPC flow logging for this subnetwork is enabled. + Configures whether metadata fields should be added to the reported VPC + flow logs. + Default value is INCLUDE_ALL_METADATA. + Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA. + """ + metadataFields: Optional[List[str]] = None + """ + List of metadata fields that should be added to reported logs. + Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Params(BaseModel): + resourceManagerTags: Optional[Dict[str, str]] = None + """ + Resource manager tags to be bound to the subnetwork. Tag keys and values have the + same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, + and values are in the format tagValues/456. The field is ignored when empty. + The field is immutable and causes resource replacement when mutated. This field is only + set at create time and modifying this field after creation will trigger recreation. + To apply tags to an existing resource, see the google_tags_tag_binding resource. + """ + + +class SecondaryIpRangeItem(BaseModel): + ipCidrRange: Optional[str] = None + """ + The range of IP addresses belonging to this subnetwork secondary + range. Provide this property when you create the subnetwork. + Ranges must be unique and non-overlapping with all primary and + secondary IP ranges within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + rangeName: Optional[str] = None + """ + The name associated with this subnetwork secondary range, used + when adding an alias IP range to a VM instance. The name must + be 1-63 characters long, and comply with RFC1035. The name + must be unique within the subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, PEER_MIGRATION or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PEER_MIGRATION is a user created subnetwork that is reserved for migrating resources from one peered network to another. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE. + """ + region: str + """ + The GCP region for this subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list of zero objects, + set send_secondary_ip_range_if_empty = true + Structure is documented below. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, PEER_MIGRATION or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PEER_MIGRATION is a user created subnetwork that is reserved for migrating resources from one peered network to another. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list of zero objects, + set send_secondary_ip_range_if_empty = true + Structure is documented below. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when + you create the resource. This field can be set only at resource + creation time. + """ + enableFlowLogs: Optional[bool] = None + """ + Whether to enable flow logging for this subnetwork. If this field is not explicitly set, + it will not appear in get listings. If not set the default behavior is determined by the + org policy, if there is no org policy specified, then it will default to disabled. + This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + """ + externalIpv6Prefix: Optional[str] = None + """ + The range of external IPv6 addresses that are owned by this subnetwork. + """ + fingerprint: Optional[str] = None + gatewayAddress: Optional[str] = None + """ + The gateway address for default routes to reach destination addresses + outside this subnetwork. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/subnetworks/{{name}} + """ + internalIpv6Prefix: Optional[str] = None + """ + The internal IPv6 address range that is assigned to this subnetwork. + """ + ipCidrRange: Optional[str] = None + """ + The range of internal addresses that are owned by this subnetwork. + Provide this property when you create the subnetwork. For example, + 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + non-overlapping within a network. Only IPv4 is supported. + Field is optional when reserved_internal_range is defined, otherwise required. + """ + ipCollection: Optional[str] = None + """ + Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP + in EXTERNAL_IPV6_SUBNETWORK_CREATION mode. + Use one of the following formats to specify a sub-PDP when creating an + IPv6 NetLB forwarding rule using BYOIP: + Full resource URL, as in: + """ + ipv6AccessType: Optional[str] = None + """ + The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation + or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet + cannot enable direct path. + Possible values are: EXTERNAL, INTERNAL. + """ + ipv6CidrRange: Optional[str] = None + """ + The range of internal IPv6 addresses that are owned by this subnetwork. + """ + ipv6GceEndpoint: Optional[str] = None + """ + Possible endpoints of this subnetwork. It can be one of the following: + """ + logConfig: Optional[LogConfig] = None + """ + This field denotes the VPC flow logging options for this subnetwork. If + logging is enabled, logs are exported to Cloud Logging. Flow logging + isn't supported if the subnet purpose field is set to subnetwork is + REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. + Structure is documented below. + """ + network: Optional[str] = None + """ + The network this subnet belongs to. + Only networks that are in the distributed mode can have subnetworks. + """ + params: Optional[Params] = None + """ + Additional params passed with the request, but not persisted as part of resource payload + Structure is documented below. + """ + privateIpGoogleAccess: Optional[bool] = None + """ + When enabled, VMs in this subnetwork without external IP addresses can + access Google APIs and services by using Private Google Access. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The private IPv6 google access type for the VMs in this subnet. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + purpose: Optional[str] = None + """ + The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, PEER_MIGRATION or PRIVATE_NAT(Beta). + A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. + A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. + A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. + A subnetwork with purpose set to PEER_MIGRATION is a user created subnetwork that is reserved for migrating resources from one peered network to another. + A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. + Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. + If unspecified, the purpose defaults to PRIVATE. + """ + region: Optional[str] = None + """ + The GCP region for this subnetwork. + """ + reservedInternalRange: Optional[str] = None + """ + The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com + E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId} + """ + role: Optional[str] = None + """ + The role of subnetwork. + Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. + The value can be set to ACTIVE or BACKUP. + An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. + A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. + Possible values are: ACTIVE, BACKUP. + """ + secondaryIpRange: Optional[List[SecondaryIpRangeItem]] = None + """ + An array of configurations for secondary IP ranges for VM instances + contained in this subnetwork. The primary IP of such VM must belong + to the primary ipCidrRange of the subnetwork. The alias IPs may belong + to either primary or secondary ranges. + Note: This field uses attr-as-block mode to avoid + breaking users during the 0.12 upgrade. To explicitly send a list of zero objects, + set send_secondary_ip_range_if_empty = true + Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sendSecondaryIpRangeIfEmpty: Optional[bool] = None + """ + Controls the removal behavior of secondary_ip_range. + When false, removing secondary_ip_range from config will not produce a diff as + the provider will default to the API's value. + When true, the provider will treat removing secondary_ip_range as sending an + empty list of secondary IP ranges to the API. + Defaults to false. + """ + stackType: Optional[str] = None + """ + The stack type for this subnet to identify whether the IPv6 feature is enabled or not. + If not specified IPV4_ONLY will be used. + Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. + """ + state: Optional[str] = None + """ + 'The state of the subnetwork, which can be one of the following values: + READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose + set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. + A subnetwork that is draining cannot be used or modified until it reaches a status of READY' + """ + subnetworkId: Optional[float] = None + """ + The unique identifier number for the resource. This identifier is defined by the server. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Subnetwork(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Subnetwork']] = 'Subnetwork' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SubnetworkSpec defines the desired state of Subnetwork + """ + status: Optional[Status] = None + """ + SubnetworkStatus defines the observed state of Subnetwork. + """ + + +class SubnetworkList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Subnetwork] + """ + List of subnetworks. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/subnetworkiammember/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/subnetworkiammember/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/subnetworkiammember/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/subnetworkiammember/v1beta1.py new file mode 100644 index 000000000..860a46d03 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/subnetworkiammember/v1beta1.py @@ -0,0 +1,267 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_subnetworkiammember.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Condition(BaseModel): + description: Optional[str] = None + expression: Optional[str] = None + title: Optional[str] = None + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class InitProvider(BaseModel): + condition: Optional[Condition] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + condition: Optional[Condition] = None + etag: Optional[str] = None + id: Optional[str] = None + member: Optional[str] = None + project: Optional[str] = None + region: Optional[str] = None + role: Optional[str] = None + subnetwork: Optional[str] = None + + +class ConditionModel(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[ConditionModel]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class SubnetworkIAMMember(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['SubnetworkIAMMember']] = 'SubnetworkIAMMember' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + SubnetworkIAMMemberSpec defines the desired state of SubnetworkIAMMember + """ + status: Optional[Status] = None + """ + SubnetworkIAMMemberStatus defines the observed state of SubnetworkIAMMember. + """ + + +class SubnetworkIAMMemberList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[SubnetworkIAMMember] + """ + List of subnetworkiammembers. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetgrpcproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/targetgrpcproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetgrpcproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/targetgrpcproxy/v1beta1.py new file mode 100644 index 000000000..dac4a500b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/targetgrpcproxy/v1beta1.py @@ -0,0 +1,351 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_targetgrpcproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + urlMap: Optional[str] = None + """ + URL to the UrlMap resource that defines the mapping from URL to + the BackendService. The protocol field in the BackendService + must be set to GRPC. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + validateForProxyless: Optional[bool] = None + """ + If true, indicates that the BackendServices referenced by + the urlMap may be accessed by gRPC applications without using + a sidecar proxy. This will enable configuration checks on urlMap + and its referenced BackendServices to not allow unsupported features. + A gRPC application must use "xds:///" scheme in the target URI + of the service it is connecting to. If false, indicates that the + BackendServices referenced by the urlMap will be accessed by gRPC + applications via a sidecar proxy. In this case, a gRPC application + must not use "xds:///" scheme in the target URI of the service + it is connecting to + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + urlMap: Optional[str] = None + """ + URL to the UrlMap resource that defines the mapping from URL to + the BackendService. The protocol field in the BackendService + must be set to GRPC. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + validateForProxyless: Optional[bool] = None + """ + If true, indicates that the BackendServices referenced by + the urlMap may be accessed by gRPC applications without using + a sidecar proxy. This will enable configuration checks on urlMap + and its referenced BackendServices to not allow unsupported features. + A gRPC application must use "xds:///" scheme in the target URI + of the service it is connecting to. If false, indicates that the + BackendServices referenced by the urlMap will be accessed by gRPC + applications via a sidecar proxy. In this case, a gRPC application + must not use "xds:///" scheme in the target URI of the service + it is connecting to + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in + this object. This field is used in optimistic locking. This field + will be ignored when inserting a TargetGrpcProxy. An up-to-date + fingerprint must be provided in order to patch/update the + TargetGrpcProxy; otherwise, the request will fail with error + 412 conditionNotMet. To see the latest fingerprint, make a get() + request to retrieve the TargetGrpcProxy. A base64-encoded string. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetGrpcProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + selfLinkWithId: Optional[str] = None + """ + Server-defined URL with id for the resource. + """ + urlMap: Optional[str] = None + """ + URL to the UrlMap resource that defines the mapping from URL to + the BackendService. The protocol field in the BackendService + must be set to GRPC. + """ + validateForProxyless: Optional[bool] = None + """ + If true, indicates that the BackendServices referenced by + the urlMap may be accessed by gRPC applications without using + a sidecar proxy. This will enable configuration checks on urlMap + and its referenced BackendServices to not allow unsupported features. + A gRPC application must use "xds:///" scheme in the target URI + of the service it is connecting to. If false, indicates that the + BackendServices referenced by the urlMap will be accessed by gRPC + applications via a sidecar proxy. In this case, a gRPC application + must not use "xds:///" scheme in the target URI of the service + it is connecting to + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetGRPCProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetGRPCProxy']] = 'TargetGRPCProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetGRPCProxySpec defines the desired state of TargetGRPCProxy + """ + status: Optional[Status] = None + """ + TargetGRPCProxyStatus defines the observed state of TargetGRPCProxy. + """ + + +class TargetGRPCProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetGRPCProxy] + """ + List of targetgrpcproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targethttpproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/targethttpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targethttpproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/targethttpproxy/v1beta1.py new file mode 100644 index 000000000..e4494fc82 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/targethttpproxy/v1beta1.py @@ -0,0 +1,358 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_targethttpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. + This field will be ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be provided in order to + patch/update the TargetHttpProxy; otherwise, the request will fail with error 412 conditionNotMet. + To see the latest fingerprint, make a get() request to retrieve the TargetHttpProxy. + A base64-encoded string. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetHttpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetHTTPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetHTTPProxy']] = 'TargetHTTPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetHTTPProxySpec defines the desired state of TargetHTTPProxy + """ + status: Optional[Status] = None + """ + TargetHTTPProxyStatus defines the observed state of TargetHTTPProxy. + """ + + +class TargetHTTPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetHTTPProxy] + """ + List of targethttpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targethttpsproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/targethttpsproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targethttpsproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/targethttpsproxy/v1beta1.py new file mode 100644 index 000000000..328f415aa --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/targethttpsproxy/v1beta1.py @@ -0,0 +1,589 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_targethttpsproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class SslCertificatesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SslCertificatesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlMapRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class UrlMapSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + Certificate manager certificates only apply when the load balancing scheme is set to INTERNAL_MANAGED. + For EXTERNAL and EXTERNAL_MANAGED, use certificate_map instead. + sslCertificates and certificateManagerCertificates fields can not be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field is only supported for EXTERNAL and EXTERNAL_MANAGED load balancing schemes. + For INTERNAL_MANAGED, use certificate_manager_certificates instead. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + quicOverride: Optional[str] = None + """ + Specifies the QUIC override policy for this resource. This determines + whether the load balancer will attempt to negotiate QUIC with clients + or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is + specified, Google manages whether QUIC is used. + Default value is NONE. + Possible values are: NONE, ENABLE, DISABLE. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + sslCertificates and certificateManagerCertificates can not be defined together. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + tlsEarlyData: Optional[str] = None + """ + Specifies whether TLS 1.3 0-RTT Data (“Early Data”) should be accepted for this service. + Early Data allows a TLS resumption handshake to include the initial application payload + (a HTTP request) alongside the handshake, reducing the effective round trips to “zero”. + This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). + Possible values are: STRICT, PERMISSIVE, UNRESTRICTED, DISABLED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class InitProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + Certificate manager certificates only apply when the load balancing scheme is set to INTERNAL_MANAGED. + For EXTERNAL and EXTERNAL_MANAGED, use certificate_map instead. + sslCertificates and certificateManagerCertificates fields can not be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field is only supported for EXTERNAL and EXTERNAL_MANAGED load balancing schemes. + For INTERNAL_MANAGED, use certificate_manager_certificates instead. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + quicOverride: Optional[str] = None + """ + Specifies the QUIC override policy for this resource. This determines + whether the load balancer will attempt to negotiate QUIC with clients + or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is + specified, Google manages whether QUIC is used. + Default value is NONE. + Possible values are: NONE, ENABLE, DISABLE. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + sslCertificates and certificateManagerCertificates can not be defined together. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + tlsEarlyData: Optional[str] = None + """ + Specifies whether TLS 1.3 0-RTT Data (“Early Data”) should be accepted for this service. + Early Data allows a TLS resumption handshake to include the initial application payload + (a HTTP request) alongside the handshake, reducing the effective round trips to “zero”. + This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). + Possible values are: STRICT, PERMISSIVE, UNRESTRICTED, DISABLED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + urlMapRef: Optional[UrlMapRef] = None + """ + Reference to a URLMap in compute to populate urlMap. + """ + urlMapSelector: Optional[UrlMapSelector] = None + """ + Selector for a URLMap in compute to populate urlMap. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + certificateManagerCertificates: Optional[List[str]] = None + """ + URLs to certificate manager certificate resources that are used to authenticate connections between users and the load balancer. + Certificate manager certificates only apply when the load balancing scheme is set to INTERNAL_MANAGED. + For EXTERNAL and EXTERNAL_MANAGED, use certificate_map instead. + sslCertificates and certificateManagerCertificates fields can not be defined together. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificates/{resourceName} or just the self_link projects/{project}/locations/{location}/certificates/{resourceName} + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field is only supported for EXTERNAL and EXTERNAL_MANAGED load balancing schemes. + For INTERNAL_MANAGED, use certificate_manager_certificates instead. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. + This field will be ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be provided in order to + patch the TargetHttpsProxy; otherwise, the request will fail with error 412 conditionNotMet. + To see the latest fingerprint, make a get() request to retrieve the TargetHttpsProxy. + A base64-encoded string. + """ + httpKeepAliveTimeoutSec: Optional[float] = None + """ + Specifies how long to keep a connection open, after completing a response, + while there is no matching traffic (in seconds). If an HTTP keepalive is + not specified, a default value will be used. For Global + external HTTP(S) load balancer, the default value is 610 seconds, the + minimum allowed value is 5 seconds and the maximum allowed value is 1200 + seconds. For cross-region internal HTTP(S) load balancer, the default + value is 600 seconds, the minimum allowed value is 5 seconds, and the + maximum allowed value is 600 seconds. For Global external HTTP(S) load + balancer (classic), this option is not available publicly. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetHttpsProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + quicOverride: Optional[str] = None + """ + Specifies the QUIC override policy for this resource. This determines + whether the load balancer will attempt to negotiate QUIC with clients + or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is + specified, Google manages whether QUIC is used. + Default value is NONE. + Possible values are: NONE, ENABLE, DISABLE. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + serverTlsPolicy: Optional[str] = None + """ + A URL referring to a networksecurity.ServerTlsPolicy + resource that describes how the proxy should authenticate inbound + traffic. serverTlsPolicy only applies to a global TargetHttpsProxy + attached to globalForwardingRules with the loadBalancingScheme + set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. + For details which ServerTlsPolicy resources are accepted with + INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED + loadBalancingScheme consult ServerTlsPolicy documentation. + If left blank, communications are not encrypted. + If you remove this field from your configuration at the same time as + deleting or recreating a referenced ServerTlsPolicy resource, you will + receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy + within the ServerTlsPolicy resource to avoid this. + """ + sslCertificates: Optional[List[str]] = None + """ + URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. + Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + sslCertificates and certificateManagerCertificates can not be defined together. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetHttpsProxy resource. If not set, the TargetHttpsProxy + resource will not have any SSL policy configured. + """ + tlsEarlyData: Optional[str] = None + """ + Specifies whether TLS 1.3 0-RTT Data (“Early Data”) should be accepted for this service. + Early Data allows a TLS resumption handshake to include the initial application payload + (a HTTP request) alongside the handshake, reducing the effective round trips to “zero”. + This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). + Possible values are: STRICT, PERMISSIVE, UNRESTRICTED, DISABLED. + """ + urlMap: Optional[str] = None + """ + A reference to the UrlMap resource that defines the mapping from URL + to the BackendService. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetHTTPSProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetHTTPSProxy']] = 'TargetHTTPSProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetHTTPSProxySpec defines the desired state of TargetHTTPSProxy + """ + status: Optional[Status] = None + """ + TargetHTTPSProxyStatus defines the observed state of TargetHTTPSProxy. + """ + + +class TargetHTTPSProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetHTTPSProxy] + """ + List of targethttpsproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetinstance/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/targetinstance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetinstance/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/targetinstance/v1beta1.py new file mode 100644 index 000000000..b6189453e --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/targetinstance/v1beta1.py @@ -0,0 +1,336 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_targetinstance.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class InstanceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class InstanceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + instance: Optional[str] = None + """ + The Compute instance VM handling traffic for this target instance. + Accepts the instance self-link, relative path + (e.g. projects/project/zones/zone/instances/instance) or name. If + name is given, the zone will default to the given zone or + the provider-default zone and the project will default to the + provider-level project. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + natPolicy: Optional[str] = None + """ + NAT option controlling how IPs are NAT'ed to the instance. + Currently only NO_NAT (default value) is supported. + Default value is NO_NAT. + Possible values are: NO_NAT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + zone: str + """ + URL of the zone where the target instance resides. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + instance: Optional[str] = None + """ + The Compute instance VM handling traffic for this target instance. + Accepts the instance self-link, relative path + (e.g. projects/project/zones/zone/instances/instance) or name. If + name is given, the zone will default to the given zone or + the provider-default zone and the project will default to the + provider-level project. + """ + instanceRef: Optional[InstanceRef] = None + """ + Reference to a Instance in compute to populate instance. + """ + instanceSelector: Optional[InstanceSelector] = None + """ + Selector for a Instance in compute to populate instance. + """ + natPolicy: Optional[str] = None + """ + NAT option controlling how IPs are NAT'ed to the instance. + Currently only NO_NAT (default value) is supported. + Default value is NO_NAT. + Possible values are: NO_NAT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/zones/{{zone}}/targetInstances/{{name}} + """ + instance: Optional[str] = None + """ + The Compute instance VM handling traffic for this target instance. + Accepts the instance self-link, relative path + (e.g. projects/project/zones/zone/instances/instance) or name. If + name is given, the zone will default to the given zone or + the provider-default zone and the project will default to the + provider-level project. + """ + natPolicy: Optional[str] = None + """ + NAT option controlling how IPs are NAT'ed to the instance. + Currently only NO_NAT (default value) is supported. + Default value is NO_NAT. + Possible values are: NO_NAT. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + zone: Optional[str] = None + """ + URL of the zone where the target instance resides. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetInstance(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetInstance']] = 'TargetInstance' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetInstanceSpec defines the desired state of TargetInstance + """ + status: Optional[Status] = None + """ + TargetInstanceStatus defines the observed state of TargetInstance. + """ + + +class TargetInstanceList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetInstance] + """ + List of targetinstances. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetpool/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/targetpool/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetpool/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/targetpool/v1beta1.py new file mode 100644 index 000000000..5841ab4c9 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/targetpool/v1beta1.py @@ -0,0 +1,364 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_targetpool.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class HealthChecksRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class HealthChecksSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backupPool: Optional[str] = None + """ + URL to the backup target pool. Must also set + failover_ratio. + """ + description: Optional[str] = None + """ + Textual description field. + """ + failoverRatio: Optional[float] = None + """ + Ratio (0 to 1) of failed nodes before using the + backup pool (which must also be set). + """ + healthChecks: Optional[List[str]] = None + """ + List of zero or one health check name or self_link. Only + legacy google_compute_http_health_check is supported. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HTTPHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HTTPHealthCheck in compute to populate healthChecks. + """ + instances: Optional[List[str]] = None + """ + List of instances in the pool. They can be given as + URLs, or in the form of "zone/name". + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: str + """ + Where the target pool resides. Defaults to project + region. + """ + sessionAffinity: Optional[str] = None + """ + How to distribute load. Options are "NONE" (no + affinity). "CLIENT_IP" (hash of the source/dest addresses / ports), and + "CLIENT_IP_PROTO" also includes the protocol (default "NONE"). + """ + + +class InitProvider(BaseModel): + backupPool: Optional[str] = None + """ + URL to the backup target pool. Must also set + failover_ratio. + """ + description: Optional[str] = None + """ + Textual description field. + """ + failoverRatio: Optional[float] = None + """ + Ratio (0 to 1) of failed nodes before using the + backup pool (which must also be set). + """ + healthChecks: Optional[List[str]] = None + """ + List of zero or one health check name or self_link. Only + legacy google_compute_http_health_check is supported. + """ + healthChecksRefs: Optional[List[HealthChecksRef]] = None + """ + References to HTTPHealthCheck in compute to populate healthChecks. + """ + healthChecksSelector: Optional[HealthChecksSelector] = None + """ + Selector for a list of HTTPHealthCheck in compute to populate healthChecks. + """ + instances: Optional[List[str]] = None + """ + List of instances in the pool. They can be given as + URLs, or in the form of "zone/name". + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + sessionAffinity: Optional[str] = None + """ + How to distribute load. Options are "NONE" (no + affinity). "CLIENT_IP" (hash of the source/dest addresses / ports), and + "CLIENT_IP_PROTO" also includes the protocol (default "NONE"). + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backupPool: Optional[str] = None + """ + URL to the backup target pool. Must also set + failover_ratio. + """ + description: Optional[str] = None + """ + Textual description field. + """ + failoverRatio: Optional[float] = None + """ + Ratio (0 to 1) of failed nodes before using the + backup pool (which must also be set). + """ + healthChecks: Optional[List[str]] = None + """ + List of zero or one health check name or self_link. Only + legacy google_compute_http_health_check is supported. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetPools/{{name}} + """ + instances: Optional[List[str]] = None + """ + List of instances in the pool. They can be given as + URLs, or in the form of "zone/name". + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + Where the target pool resides. Defaults to project + region. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sessionAffinity: Optional[str] = None + """ + How to distribute load. Options are "NONE" (no + affinity). "CLIENT_IP" (hash of the source/dest addresses / ports), and + "CLIENT_IP_PROTO" also includes the protocol (default "NONE"). + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetPool(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetPool']] = 'TargetPool' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetPoolSpec defines the desired state of TargetPool + """ + status: Optional[Status] = None + """ + TargetPoolStatus defines the observed state of TargetPool. + """ + + +class TargetPoolList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetPool] + """ + List of targetpools. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetsslproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/targetsslproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targetsslproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/targetsslproxy/v1beta1.py new file mode 100644 index 000000000..bcdd677a7 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/targetsslproxy/v1beta1.py @@ -0,0 +1,422 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_targetsslproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SslCertificatesRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SslCertificatesSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field can only be set for global target proxies. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + sslCertificates: Optional[List[str]] = None + """ + A list of SslCertificate resources that are used to authenticate + connections between users and the load balancer. At least one + SSL certificate must be specified. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetSslProxy resource. If not set, the TargetSslProxy + resource will not have any SSL policy configured. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field can only be set for global target proxies. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + sslCertificates: Optional[List[str]] = None + """ + A list of SslCertificate resources that are used to authenticate + connections between users and the load balancer. At least one + SSL certificate must be specified. + """ + sslCertificatesRefs: Optional[List[SslCertificatesRef]] = None + """ + References to SSLCertificate in compute to populate sslCertificates. + """ + sslCertificatesSelector: Optional[SslCertificatesSelector] = None + """ + Selector for a list of SSLCertificate in compute to populate sslCertificates. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetSslProxy resource. If not set, the TargetSslProxy + resource will not have any SSL policy configured. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + certificateMap: Optional[str] = None + """ + A reference to the CertificateMap resource uri that identifies a certificate map + associated with the given target proxy. This field can only be set for global target proxies. + Accepted format is //certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetSslProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sslCertificates: Optional[List[str]] = None + """ + A list of SslCertificate resources that are used to authenticate + connections between users and the load balancer. At least one + SSL certificate must be specified. + """ + sslPolicy: Optional[str] = None + """ + A reference to the SslPolicy resource that will be associated with + the TargetSslProxy resource. If not set, the TargetSslProxy + resource will not have any SSL policy configured. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetSSLProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetSSLProxy']] = 'TargetSSLProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetSSLProxySpec defines the desired state of TargetSSLProxy + """ + status: Optional[Status] = None + """ + TargetSSLProxyStatus defines the observed state of TargetSSLProxy. + """ + + +class TargetSSLProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetSSLProxy] + """ + List of targetsslproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targettcpproxy/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/targettcpproxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/targettcpproxy/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/targettcpproxy/v1beta1.py new file mode 100644 index 000000000..0f6a25137 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/targettcpproxy/v1beta1.py @@ -0,0 +1,332 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_targettcpproxy.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + + +class InitProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + backendService: Optional[str] = None + """ + A reference to the BackendService resource. + """ + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/targetTcpProxies/{{name}} + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + proxyBind: Optional[bool] = None + """ + This field only applies when the forwarding rule that references + this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + """ + proxyHeader: Optional[str] = None + """ + Specifies the type of proxy header to append before sending data to + the backend. + Default value is NONE. + Possible values are: NONE, PROXY_V1. + """ + proxyId: Optional[float] = None + """ + The unique identifier for the resource. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class TargetTCPProxy(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['TargetTCPProxy']] = 'TargetTCPProxy' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + TargetTCPProxySpec defines the desired state of TargetTCPProxy + """ + status: Optional[Status] = None + """ + TargetTCPProxyStatus defines the observed state of TargetTCPProxy. + """ + + +class TargetTCPProxyList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[TargetTCPProxy] + """ + List of targettcpproxies. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/urlmap/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/urlmap/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/urlmap/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/urlmap/v1beta1.py new file mode 100644 index 000000000..8c571d70f --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/urlmap/v1beta1.py @@ -0,0 +1,2683 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_urlmap.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ErrorResponseRuleItem(BaseModel): + matchResponseCodes: Optional[List[str]] = None + """ + Valid values include: + """ + overrideResponseCode: Optional[float] = None + """ + The HTTP status code returned with the response containing the custom error content. + If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ErrorServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ErrorServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultCustomErrorResponsePolicy(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class CorsPolicy(BaseModel): + allowCredentials: Optional[bool] = None + """ + In response to a preflight request, setting this to true indicates that the + actual request can include user credentials. This translates to the Access- + Control-Allow-Credentials header. Defaults to false. + """ + allowHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Headers header. + """ + allowMethods: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Allow-Methods header. + """ + allowOriginRegexes: Optional[List[str]] = None + """ + Specifies the regular expression patterns that match allowed origins. For + regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + An origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + allowOrigins: Optional[List[str]] = None + """ + Specifies the list of origins that will be allowed to do CORS requests. An + origin is allowed if it matches either allow_origins or allow_origin_regex. + """ + disabled: Optional[bool] = None + """ + If true, specifies the CORS policy is disabled. + """ + exposeHeaders: Optional[List[str]] = None + """ + Specifies the content for the Access-Control-Expose-Headers header. + """ + maxAge: Optional[float] = None + """ + Specifies how long the results of a preflight request can be cached. This + translates to the content for the Access-Control-Max-Age header. + """ + + +class Abort(BaseModel): + httpStatus: Optional[float] = None + """ + The HTTP status code used to abort the request. The value must be between 200 + and 599 inclusive. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FixedDelay(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class Delay(BaseModel): + fixedDelay: Optional[FixedDelay] = None + """ + Specifies the value of the fixed delay interval. + Structure is documented below. + """ + percentage: Optional[float] = None + """ + The percentage of traffic (connections/operations/requests) on which delay will + be introduced as part of fault injection. The value must be between 0.0 and + 100.0 inclusive. + """ + + +class FaultInjectionPolicy(BaseModel): + abort: Optional[Abort] = None + """ + The specification for how client requests are aborted as part of fault + injection. + Structure is documented below. + """ + delay: Optional[Delay] = None + """ + The specification for how client requests are delayed as part of fault + injection, before being sent to a backend service. + Structure is documented below. + """ + + +class MaxStreamDuration(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class BackendServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class BackendServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RequestMirrorPolicy(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + + +class PerTryTimeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class RetryPolicy(BaseModel): + numRetries: Optional[float] = None + """ + Specifies the allowed number retries. This number must be > 0. + """ + perTryTimeout: Optional[PerTryTimeout] = None + """ + Specifies a non-zero timeout per retry attempt. + Structure is documented below. + """ + retryConditions: Optional[List[str]] = None + """ + Specifies one or more conditions when this retry rule applies. Valid values are: + """ + + +class Timeout(BaseModel): + nanos: Optional[float] = None + """ + Span of time that's a fraction of a second at nanosecond resolution. Durations + less than one second are represented with a 0 seconds field and a positive + nanos field. Must be from 0 to 999,999,999 inclusive. + """ + seconds: Optional[str] = None + """ + Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 + inclusive. + """ + + +class UrlRewrite(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class RequestHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class ResponseHeadersToAddItem(BaseModel): + headerName: Optional[str] = None + """ + The name of the header. + """ + headerValue: Optional[str] = None + """ + The value of the header to add. + """ + replace: Optional[bool] = None + """ + If false, headerValue is appended to any values that already exist for the + header. If true, headerValue is set for the header, discarding any values that + were set for that header. + """ + + +class HeaderAction(BaseModel): + requestHeadersToAdd: Optional[List[RequestHeadersToAddItem]] = None + """ + Headers to add to a matching request prior to forwarding the request to the + backendService. + Structure is documented below. + """ + requestHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the request + prior to forwarding the request to the backendService. + """ + responseHeadersToAdd: Optional[List[ResponseHeadersToAddItem]] = None + """ + Headers to add the response prior to sending the response back to the client. + Structure is documented below. + """ + responseHeadersToRemove: Optional[List[str]] = None + """ + A list of header names for headers that need to be removed from the response + prior to sending the response back to the client. + """ + + +class WeightedBackendService(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class DefaultRouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class DefaultServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class DefaultUrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class HostRuleItem(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + hosts: Optional[List[str]] = None + """ + The list of host patterns to match. They must be valid hostnames, except * will + match any string of ([a-z0-9-.]*). In that case, * must be the first character + and must be followed in the pattern by either - or .. + """ + pathMatcher: Optional[str] = None + """ + The name of the PathMatcher to use to match the path portion of the URL if the + hostRule matches the URL's host portion. + """ + + +class DefaultRouteActionModel(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendService]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class CustomErrorResponsePolicy(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class WeightedBackendServiceModel(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteAction(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicy] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewrite] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class ServiceRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UrlRedirect(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class PathRuleItem(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicy] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendBucket in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class CustomErrorResponsePolicyModel(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class RangeMatch(BaseModel): + rangeEnd: Optional[float] = None + """ + The end of the range (exclusive). + """ + rangeStart: Optional[float] = None + """ + The start of the range (inclusive). + """ + + +class HeaderMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + headerName: Optional[str] = None + """ + The name of the header. + """ + invertMatch: Optional[bool] = None + """ + If set to false, the headerMatch is considered a match if the match criteria + above are met. If set to true, the headerMatch is considered a match if the + match criteria above are NOT met. Defaults to false. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + rangeMatch: Optional[RangeMatch] = None + """ + The header value must be an integer and its value must be in the range specified + in rangeMatch. If the header does not contain an integer, number or is empty, + the match fails. For example for a range [-5, 0] - -3 will match. - 0 will + not match. - 0.25 will not match. - -3someString will not match. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + suffixMatch: Optional[str] = None + """ + The value of the header must end with the contents of suffixMatch. Only one of + exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch + must be set. + """ + + +class FilterLabel(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + Header value. + """ + + +class MetadataFilter(BaseModel): + filterLabels: Optional[List[FilterLabel]] = None + """ + The list of label value pairs that must match labels in the provided metadata + based on filterMatchCriteria This list must not be empty and can have at the + most 64 entries. + Structure is documented below. + """ + filterMatchCriteria: Optional[str] = None + """ + Specifies how individual filterLabel matches within the list of filterLabels + contribute towards the overall metadataFilter match. Supported values are: + """ + + +class QueryParameterMatch(BaseModel): + exactMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter exactly matches + the contents of exactMatch. Only one of presentMatch, exactMatch and regexMatch + must be set. + """ + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + presentMatch: Optional[bool] = None + """ + Specifies that the queryParameterMatch matches if the request contains the query + parameter, irrespective of whether the parameter has a value or not. Only one of + presentMatch, exactMatch and regexMatch must be set. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class MatchRule(BaseModel): + fullPathMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request must exactly + match the value specified in fullPathMatch after removing any query parameters + and anchor that may be part of the original URL. FullPathMatch must be between 1 + and 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must + be specified. + """ + headerMatches: Optional[List[HeaderMatch]] = None + """ + Specifies a list of header match criteria, all of which must match corresponding + headers in the request. + Structure is documented below. + """ + ignoreCase: Optional[bool] = None + """ + Specifies that prefixMatch and fullPathMatch matches are case sensitive. + Defaults to false. + """ + metadataFilters: Optional[List[MetadataFilter]] = None + """ + Opaque filter criteria used by Loadbalancer to restrict routing configuration to + a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS + clients present node metadata. If a match takes place, the relevant routing + configuration is made available to those proxies. For each metadataFilter in + this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the + filterLabels must match the corresponding label provided in the metadata. If its + filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match + with corresponding labels in the provided metadata. metadataFilters specified + here can be overrides those specified in ForwardingRule that refers to this + UrlMap. metadataFilters only applies to Loadbalancers that have their + loadBalancingScheme set to INTERNAL_SELF_MANAGED. + Structure is documented below. + """ + pathTemplateMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the path of the request + must match the wildcard pattern specified in pathTemplateMatch + after removing any query parameters and anchor that may be part + of the original URL. + pathTemplateMatch must be between 1 and 255 characters + (inclusive). The pattern specified by pathTemplateMatch may + have at most 5 wildcard operators and at most 5 variable + captures in total. + """ + prefixMatch: Optional[str] = None + """ + For satisfying the matchRule condition, the request's path must begin with the + specified prefixMatch. prefixMatch must begin with a /. The value must be + between 1 and 1024 characters. Only one of prefixMatch, fullPathMatch or + regexMatch must be specified. + """ + queryParameterMatches: Optional[List[QueryParameterMatch]] = None + """ + Specifies a list of query parameter match criteria, all of which must match + corresponding query parameters in the request. + Structure is documented below. + """ + regexMatch: Optional[str] = None + """ + The queryParameterMatch matches if the value of the parameter matches the + regular expression specified by regexMatch. For the regular expression grammar, + please see en.cppreference.com/w/cpp/regex/ecmascript Only one of presentMatch, + exactMatch and regexMatch must be set. + """ + + +class RequestMirrorPolicyModel(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel1(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class RouteRule(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicyModel] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendService in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendService in compute to populate service. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItem(BaseModel): + defaultCustomErrorResponsePolicy: Optional[DefaultCustomErrorResponsePolicy] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given paths match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. HeaderAction specified here are applied after the + matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + Structure is documented below. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItem]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRule]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class Header(BaseModel): + name: Optional[str] = None + """ + The name of the query parameter to match. The query parameter must exist in the + request, in the absence of which the request match fails. + """ + value: Optional[str] = None + """ + Header value. + """ + + +class TestItem(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + expectedOutputUrl: Optional[str] = None + """ + The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. + For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. + For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies httpsRedirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies stripQuery, the test passes only if expectedOutputUrl does not contain any query parameters. + expectedOutputUrl is optional when service is specified. + """ + expectedRedirectResponseCode: Optional[float] = None + """ + For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. + expectedRedirectResponseCode cannot be set when service is set. + """ + headers: Optional[List[Header]] = None + """ + HTTP headers for this request. + Structure is documented below. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + serviceRef: Optional[ServiceRef] = None + """ + Reference to a BackendBucket in compute to populate service. + """ + serviceSelector: Optional[ServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate service. + """ + + +class ForProvider(BaseModel): + defaultCustomErrorResponsePolicy: Optional[DefaultCustomErrorResponsePolicy] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteAction] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirect] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class RequestMirrorPolicyModel1(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + + +class UrlRewriteModel1(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionModel1(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel1] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel1(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class DefaultRouteActionModel2(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel1] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel1] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel1]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel2(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class CustomErrorResponsePolicyModel1(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + errorServiceRef: Optional[ErrorServiceRef] = None + """ + Reference to a BackendBucket in compute to populate errorService. + """ + errorServiceSelector: Optional[ErrorServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate errorService. + """ + + +class WeightedBackendServiceModel2(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + backendServiceRef: Optional[BackendServiceRef] = None + """ + Reference to a BackendService in compute to populate backendService. + """ + backendServiceSelector: Optional[BackendServiceSelector] = None + """ + Selector for a BackendService in compute to populate backendService. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class CustomErrorResponsePolicyModel2(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class RequestMirrorPolicyModel2(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + + +class UrlRewriteModel2(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class WeightedBackendServiceModel3(BaseModel): + backendService: Optional[str] = None + """ + The default BackendService resource. Before + forwarding the request to backendService, the loadbalancer applies any relevant + headerActions specified as part of this backendServiceWeight. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + weight: Optional[float] = None + """ + Specifies the fraction of traffic sent to backendService, computed as weight / + (sum of all weightedBackendService weights in routeAction) . The selection of a + backend service is determined only for new traffic. Once a user's request has + been directed to a backendService, subsequent requests will be sent to the same + backendService as determined by the BackendService's session affinity policy. + The value must be between 0 and 1000 + """ + + +class InitProvider(BaseModel): + defaultCustomErrorResponsePolicy: Optional[DefaultCustomErrorResponsePolicy] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel1] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultServiceRef: Optional[DefaultServiceRef] = None + """ + Reference to a BackendBucket in compute to populate defaultService. + """ + defaultServiceSelector: Optional[DefaultServiceSelector] = None + """ + Selector for a BackendBucket in compute to populate defaultService. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel1] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + pathMatcher: Optional[List[PathMatcherItem]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + test: Optional[List[TestItem]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class DefaultCustomErrorResponsePolicyModel(BaseModel): + errorResponseRule: Optional[List[ErrorResponseRuleItem]] = None + """ + Specifies rules for returning error responses. + In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. + For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). + If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + Structure is documented below. + """ + errorService: Optional[str] = None + """ + The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: + https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket + compute/v1/projects/project/global/backendBuckets/myBackendBucket + global/backendBuckets/myBackendBucket + If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. + If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). + """ + + +class UrlRewriteModel3(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + + +class DefaultRouteActionModel3(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see + W3C Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. + As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a + percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted + by the Loadbalancer for a percentage of requests. + timeout and retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. + Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, + the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time the request has been + fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + If not specified, will use the largest timeout among all backend services associated with the route. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel3] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to the matched service. + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel3]] = None + """ + A list of weighted backend services to send traffic to when a route match occurs. + The weights determine the fraction of traffic that flows to their corresponding backend service. + If all traffic needs to go to a single backend service, there must be one weightedBackendService + with weight set to a non 0 number. + Once a backendService is identified and before forwarding the request to the backend service, + advanced routing actions like Url rewrites and header transformations are applied depending on + additional settings specified in this HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel3(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one that was + supplied in the request. The value must be between 1 and 255 characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. If set to + false, the URL scheme of the redirected request will remain the same as that of the + request. This must only be set for UrlMaps used in TargetHttpProxys. Setting this + true for TargetHttpsProxy is not permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one that was + supplied in the request. pathRedirect cannot be supplied together with + prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the + original request will be used for the redirect. The value must be between 1 and 1024 + characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, + retaining the remaining portion of the URL before redirecting the request. + prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or + neither. If neither is supplied, the path of the original request will be used for + the redirect. The value must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is removed prior + to redirecting the request. If set to false, the query portion of the original URL is + retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class DefaultRouteActionModel4(BaseModel): + corsPolicy: Optional[CorsPolicy] = None + """ + The specification for allowing client side cross-origin requests. Please see W3C + Recommendation for Cross Origin Resource Sharing + Structure is documented below. + """ + faultInjectionPolicy: Optional[FaultInjectionPolicy] = None + """ + The specification for fault injection introduced into traffic to test the + resiliency of clients to backend service failure. As part of fault injection, + when clients send requests to a backend service, delays can be introduced by + Loadbalancer on a percentage of requests before sending those request to the + backend service. Similarly requests from clients can be aborted by the + Loadbalancer for a percentage of requests. timeout and retry_policy will be + ignored by clients that are configured with a fault_injection_policy. + Structure is documented below. + """ + maxStreamDuration: Optional[MaxStreamDuration] = None + """ + Specifies the maximum duration (timeout) for streams on the selected route. + Unlike the Timeout field where the timeout duration starts from the time the request + has been fully processed (known as end-of-stream), the duration in this field + is computed from the beginning of the stream until the response has been processed, + including all retries. A stream that does not complete in this duration is closed. + Structure is documented below. + """ + requestMirrorPolicy: Optional[RequestMirrorPolicyModel2] = None + """ + Specifies the policy on how requests intended for the route's backends are + shadowed to a separate mirrored backend service. Loadbalancer does not wait for + responses from the shadow service. Prior to sending traffic to the shadow + service, the host / authority header is suffixed with -shadow. + Structure is documented below. + """ + retryPolicy: Optional[RetryPolicy] = None + """ + Specifies the retry policy associated with this route. + Structure is documented below. + """ + timeout: Optional[Timeout] = None + """ + Specifies the timeout for the selected route. Timeout is computed from the time + the request is has been fully processed (i.e. end-of-stream) up until the + response has been completely processed. Timeout includes all retries. If not + specified, the default value is 15 seconds. + Structure is documented below. + """ + urlRewrite: Optional[UrlRewriteModel3] = None + """ + The spec to modify the URL of the request, prior to forwarding the request to + the matched service + Structure is documented below. + """ + weightedBackendServices: Optional[List[WeightedBackendServiceModel3]] = None + """ + A list of weighted backend services to send traffic to when a route match + occurs. The weights determine the fraction of traffic that flows to their + corresponding backend service. If all traffic needs to go to a single backend + service, there must be one weightedBackendService with weight set to a non 0 + number. Once a backendService is identified and before forwarding the request to + the backend service, advanced routing actions like Url rewrites and header + transformations are applied depending on additional settings specified in this + HttpRouteAction. + Structure is documented below. + """ + + +class DefaultUrlRedirectModel4(BaseModel): + hostRedirect: Optional[str] = None + """ + The host that will be used in the redirect response instead of the one + that was supplied in the request. The value must be between 1 and 255 + characters. + """ + httpsRedirect: Optional[bool] = None + """ + If set to true, the URL scheme in the redirected request is set to https. + If set to false, the URL scheme of the redirected request will remain the + same as that of the request. This must only be set for UrlMaps used in + TargetHttpProxys. Setting this true for TargetHttpsProxy is not + permitted. The default is set to false. + """ + pathRedirect: Optional[str] = None + """ + The path that will be used in the redirect response instead of the one + that was supplied in the request. pathRedirect cannot be supplied + together with prefixRedirect. Supply one alone or neither. If neither is + supplied, the path of the original request will be used for the redirect. + The value must be between 1 and 1024 characters. + """ + prefixRedirect: Optional[str] = None + """ + The prefix that replaces the prefixMatch specified in the + HttpRouteRuleMatch, retaining the remaining portion of the URL before + redirecting the request. prefixRedirect cannot be supplied together with + pathRedirect. Supply one alone or neither. If neither is supplied, the + path of the original request will be used for the redirect. The value + must be between 1 and 1024 characters. + """ + redirectResponseCode: Optional[str] = None + """ + The HTTP Status code to use for this RedirectAction. Supported values are: + """ + stripQuery: Optional[bool] = None + """ + If set to true, any accompanying query portion of the original URL is + removed prior to redirecting the request. If set to false, the query + portion of the original URL is retained. + This field is required to ensure an empty block is not set. The normal default value is false. + """ + + +class PathRuleItemModel(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicyModel2] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + paths: Optional[List[str]] = None + """ + The list of path patterns to match. Each must start with / and the only place a + * is allowed is at the end following a /. The string fed to the path matcher + does not include any text after the first ? or #, and those chars are not + allowed here. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class UrlRewriteModel4(BaseModel): + hostRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected service, the request's host + header is replaced with contents of hostRewrite. The value must be between 1 and + 255 characters. + """ + pathPrefixRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected backend service, the matching + portion of the request's path is replaced by pathPrefixRewrite. The value must + be between 1 and 1024 characters. + """ + pathTemplateRewrite: Optional[str] = None + """ + Prior to forwarding the request to the selected origin, if the + request matched a pathTemplateMatch, the matching portion of the + request's path is replaced re-written using the pattern specified + by pathTemplateRewrite. + pathTemplateRewrite must be between 1 and 255 characters + (inclusive), must start with a '/', and must only use variables + captured by the route's pathTemplate matchers. + pathTemplateRewrite may only be used when all of a route's + MatchRules specify pathTemplate. + Only one of pathPrefixRewrite and pathTemplateRewrite may be + specified. + """ + + +class RouteRuleModel(BaseModel): + customErrorResponsePolicy: Optional[CustomErrorResponsePolicyModel2] = None + """ + customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + Structure is documented below. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. headerAction specified here take effect before + headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + Structure is documented below. + """ + matchRules: Optional[List[MatchRule]] = None + """ + The rules for determining a match. + Structure is documented below. + """ + priority: Optional[float] = None + """ + For routeRules within a given pathMatcher, priority determines the order + in which load balancer will interpret routeRules. RouteRules are evaluated + in order of priority, from the lowest to highest number. The priority of + a rule decreases as its number increases (1, 2, 3, N+1). The first rule + that matches the request is applied. + You cannot configure two or more routeRules with the same priority. + Priority for each rule must be set to a number between 0 and + 2147483647 inclusive. + Priority numbers can have gaps, which enable you to add or remove rules + in the future without affecting the rest of the rules. For example, + 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which + you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the + future without any impact on existing rules. + """ + routeAction: Optional[RouteAction] = None + """ + In response to a matching matchRule, the load balancer performs advanced routing + actions like URL rewrites, header transformations, etc. prior to forwarding the + request to the selected backend. If routeAction specifies any + weightedBackendServices, service must not be set. Conversely if service is set, + routeAction cannot contain any weightedBackendServices. Only one of routeAction + or urlRedirect must be set. + Structure is documented below. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + urlRedirect: Optional[UrlRedirect] = None + """ + When this rule is matched, the request is redirected to a URL specified by + urlRedirect. If urlRedirect is specified, service or routeAction must not be + set. + Structure is documented below. + """ + + +class PathMatcherItemModel(BaseModel): + defaultCustomErrorResponsePolicy: Optional[ + DefaultCustomErrorResponsePolicyModel + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel4] = None + """ + defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs + advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request + to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. + Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given paths match. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel4] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. HeaderAction specified here are applied after the + matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + Structure is documented below. + """ + name: Optional[str] = None + """ + The name to which this PathMatcher is referred by the HostRule. + """ + pathRule: Optional[List[PathRuleItemModel]] = None + """ + The list of path rules. Use this list instead of routeRules when routing based + on simple path matching is all that's required. The order by which path rules + are specified does not matter. Matches are always done on the longest-path-first + basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* + irrespective of the order in which those paths appear in this list. Within a + given pathMatcher, only one of pathRules or routeRules must be set. + Structure is documented below. + """ + routeRules: Optional[List[RouteRuleModel]] = None + """ + The list of ordered HTTP route rules. Use this list instead of pathRules when + advanced route matching and routing actions are desired. The order of specifying + routeRules matters: the first rule that matches will cause its specified routing + action to take effect. Within a given pathMatcher, only one of pathRules or + routeRules must be set. routeRules are not supported in UrlMaps intended for + External load balancers. + Structure is documented below. + """ + + +class TestItemModel(BaseModel): + description: Optional[str] = None + """ + Description of this test case. + """ + expectedOutputUrl: Optional[str] = None + """ + The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. + For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. + For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies httpsRedirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies stripQuery, the test passes only if expectedOutputUrl does not contain any query parameters. + expectedOutputUrl is optional when service is specified. + """ + expectedRedirectResponseCode: Optional[float] = None + """ + For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. + expectedRedirectResponseCode cannot be set when service is set. + """ + headers: Optional[List[Header]] = None + """ + HTTP headers for this request. + Structure is documented below. + """ + host: Optional[str] = None + """ + Host portion of the URL. + """ + path: Optional[str] = None + """ + Path portion of the URL. + """ + service: Optional[str] = None + """ + The backend service or backend bucket link that should be matched by this test. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + defaultCustomErrorResponsePolicy: Optional[ + DefaultCustomErrorResponsePolicyModel + ] = None + """ + defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendService or BackendBucket responds with an error. + This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. + For example, consider a UrlMap with the following configuration: + UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors + A RouteRule for /coming_soon/ is configured for the error code 404. + If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. + When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. + defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + Structure is documented below. + """ + defaultRouteAction: Optional[DefaultRouteActionModel3] = None + """ + defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions + like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. + If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService + is set, defaultRouteAction cannot contain any weightedBackendServices. + Only one of defaultRouteAction or defaultUrlRedirect must be set. + Structure is documented below. + """ + defaultService: Optional[str] = None + """ + The backend service or backend bucket to use when none of the given rules match. + """ + defaultUrlRedirect: Optional[DefaultUrlRedirectModel3] = None + """ + When none of the specified hostRules match, the request is redirected to a URL specified + by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or + defaultRouteAction must not be set. + Structure is documented below. + """ + description: Optional[str] = None + """ + An optional description of this resource. Provide this property when you create + the resource. + """ + fingerprint: Optional[str] = None + """ + Fingerprint of this resource. A hash of the contents stored in this object. This + field is used in optimistic locking. + """ + headerAction: Optional[HeaderAction] = None + """ + Specifies changes to request and response headers that need to take effect for + the selected backendService. The headerAction specified here take effect after + headerAction specified under pathMatcher. + Structure is documented below. + """ + hostRule: Optional[List[HostRuleItem]] = None + """ + The list of HostRules to use against the URL. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/global/urlMaps/{{name}} + """ + mapId: Optional[float] = None + """ + The unique identifier for the resource. + """ + pathMatcher: Optional[List[PathMatcherItemModel]] = None + """ + The list of named PathMatchers to use against the URL. + Structure is documented below. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + test: Optional[List[TestItemModel]] = None + """ + The list of expected URL mapping tests. Request to update this UrlMap will + succeed only if all of the test cases pass. You can specify a maximum of 100 + tests per UrlMap. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class URLMap(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['URLMap']] = 'URLMap' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + URLMapSpec defines the desired state of URLMap + """ + status: Optional[Status] = None + """ + URLMapStatus defines the observed state of URLMap. + """ + + +class URLMapList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[URLMap] + """ + List of urlmaps. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/vpngateway/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/vpngateway/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/vpngateway/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/vpngateway/v1beta1.py new file mode 100644 index 000000000..960fef825 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/vpngateway/v1beta1.py @@ -0,0 +1,304 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_vpngateway.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The region this gateway should sit in. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + gatewayId: Optional[float] = None + """ + The unique identifier for the resource. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}} + """ + network: Optional[str] = None + """ + The network this VPN gateway is accepting traffic for. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region this gateway should sit in. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class VPNGateway(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['VPNGateway']] = 'VPNGateway' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + VPNGatewaySpec defines the desired state of VPNGateway + """ + status: Optional[Status] = None + """ + VPNGatewayStatus defines the observed state of VPNGateway. + """ + + +class VPNGatewayList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[VPNGateway] + """ + List of vpngateways. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/compute/vpntunnel/__init__.py b/schemas/python/models/io/upbound/m/gcp/compute/vpntunnel/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/compute/vpntunnel/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/compute/vpntunnel/v1beta1.py new file mode 100644 index 000000000..f4a3d6d57 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/compute/vpntunnel/v1beta1.py @@ -0,0 +1,676 @@ +# generated by datamodel-codegen: +# filename: workdir/compute_gcp_m_upbound_io_v1beta1_vpntunnel.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class PeerExternalGatewayRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PeerExternalGatewaySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class RouterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class RouterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class SharedSecretSecretRef(BaseModel): + key: str + name: str + """ + Name of the secret. + """ + + +class TargetVpnGatewayRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class TargetVpnGatewaySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class VpnGatewayRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class VpnGatewaySelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ForProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + ikeVersion: Optional[float] = None + """ + IKE protocol version to use when establishing the VPN tunnel with + peer VPN gateway. + Acceptable IKE versions are 1 or 2. Default version is 2. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this VpnTunnel. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + localTrafficSelector: Optional[List[str]] = None + """ + Local traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + peerExternalGateway: Optional[str] = None + """ + URL of the peer side external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayInterface: Optional[float] = None + """ + The interface ID of the external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayRef: Optional[PeerExternalGatewayRef] = None + """ + Reference to a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerExternalGatewaySelector: Optional[PeerExternalGatewaySelector] = None + """ + Selector for a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerGcpGateway: Optional[str] = None + """ + URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. + If provided, the VPN tunnel will automatically use the same vpn_gateway_interface + ID in the peer GCP VPN gateway. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + peerIp: Optional[str] = None + """ + IP address of the peer VPN gateway. Only IPv4 is supported. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: str + """ + The region where the tunnel is located. If unset, is set to the region of target_vpn_gateway. + """ + remoteTrafficSelector: Optional[List[str]] = None + """ + Remote traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + router: Optional[str] = None + """ + URL of router resource to be used for dynamic routing. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + sharedSecretSecretRef: Optional[SharedSecretSecretRef] = None + """ + Shared secret used to set the secure session between the Cloud VPN + gateway and the peer VPN gateway. + Note: This property is sensitive and will not be displayed in the plan. + """ + targetVpnGateway: Optional[str] = None + """ + URL of the Target VPN gateway with which this VPN tunnel is + associated. + """ + targetVpnGatewayRef: Optional[TargetVpnGatewayRef] = None + """ + Reference to a VPNGateway in compute to populate targetVpnGateway. + """ + targetVpnGatewaySelector: Optional[TargetVpnGatewaySelector] = None + """ + Selector for a VPNGateway in compute to populate targetVpnGateway. + """ + vpnGateway: Optional[str] = None + """ + URL of the VPN gateway with which this VPN tunnel is associated. + This must be used if a High Availability VPN gateway resource is created. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + vpnGatewayInterface: Optional[float] = None + """ + The interface ID of the VPN gateway with which this VPN tunnel is associated. + """ + vpnGatewayRef: Optional[VpnGatewayRef] = None + """ + Reference to a HaVPNGateway in compute to populate vpnGateway. + """ + vpnGatewaySelector: Optional[VpnGatewaySelector] = None + """ + Selector for a HaVPNGateway in compute to populate vpnGateway. + """ + + +class InitProvider(BaseModel): + description: Optional[str] = None + """ + An optional description of this resource. + """ + ikeVersion: Optional[float] = None + """ + IKE protocol version to use when establishing the VPN tunnel with + peer VPN gateway. + Acceptable IKE versions are 1 or 2. Default version is 2. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this VpnTunnel. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + localTrafficSelector: Optional[List[str]] = None + """ + Local traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + peerExternalGateway: Optional[str] = None + """ + URL of the peer side external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayInterface: Optional[float] = None + """ + The interface ID of the external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayRef: Optional[PeerExternalGatewayRef] = None + """ + Reference to a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerExternalGatewaySelector: Optional[PeerExternalGatewaySelector] = None + """ + Selector for a ExternalVPNGateway in compute to populate peerExternalGateway. + """ + peerGcpGateway: Optional[str] = None + """ + URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. + If provided, the VPN tunnel will automatically use the same vpn_gateway_interface + ID in the peer GCP VPN gateway. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + peerIp: Optional[str] = None + """ + IP address of the peer VPN gateway. Only IPv4 is supported. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + remoteTrafficSelector: Optional[List[str]] = None + """ + Remote traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + router: Optional[str] = None + """ + URL of router resource to be used for dynamic routing. + """ + routerRef: Optional[RouterRef] = None + """ + Reference to a Router in compute to populate router. + """ + routerSelector: Optional[RouterSelector] = None + """ + Selector for a Router in compute to populate router. + """ + sharedSecretSecretRef: SharedSecretSecretRef + """ + Shared secret used to set the secure session between the Cloud VPN + gateway and the peer VPN gateway. + Note: This property is sensitive and will not be displayed in the plan. + """ + targetVpnGateway: Optional[str] = None + """ + URL of the Target VPN gateway with which this VPN tunnel is + associated. + """ + targetVpnGatewayRef: Optional[TargetVpnGatewayRef] = None + """ + Reference to a VPNGateway in compute to populate targetVpnGateway. + """ + targetVpnGatewaySelector: Optional[TargetVpnGatewaySelector] = None + """ + Selector for a VPNGateway in compute to populate targetVpnGateway. + """ + vpnGateway: Optional[str] = None + """ + URL of the VPN gateway with which this VPN tunnel is associated. + This must be used if a High Availability VPN gateway resource is created. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + vpnGatewayInterface: Optional[float] = None + """ + The interface ID of the VPN gateway with which this VPN tunnel is associated. + """ + vpnGatewayRef: Optional[VpnGatewayRef] = None + """ + Reference to a HaVPNGateway in compute to populate vpnGateway. + """ + vpnGatewaySelector: Optional[VpnGatewaySelector] = None + """ + Selector for a HaVPNGateway in compute to populate vpnGateway. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + creationTimestamp: Optional[str] = None + """ + Creation timestamp in RFC3339 text format. + """ + description: Optional[str] = None + """ + An optional description of this resource. + """ + detailedStatus: Optional[str] = None + """ + Detailed status message for the VPN tunnel. + """ + effectiveLabels: Optional[Dict[str, str]] = None + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/regions/{{region}}/vpnTunnels/{{name}} + """ + ikeVersion: Optional[float] = None + """ + IKE protocol version to use when establishing the VPN tunnel with + peer VPN gateway. + Acceptable IKE versions are 1 or 2. Default version is 2. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint used for optimistic locking of this resource. Used + internally during updates. + """ + labels: Optional[Dict[str, str]] = None + """ + Labels to apply to this VpnTunnel. + Note: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field effective_labels for all of the labels present on the resource. + """ + localTrafficSelector: Optional[List[str]] = None + """ + Local traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + peerExternalGateway: Optional[str] = None + """ + URL of the peer side external VPN gateway to which this VPN tunnel is connected. + """ + peerExternalGatewayInterface: Optional[float] = None + """ + The interface ID of the external VPN gateway to which this VPN tunnel is connected. + """ + peerGcpGateway: Optional[str] = None + """ + URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. + If provided, the VPN tunnel will automatically use the same vpn_gateway_interface + ID in the peer GCP VPN gateway. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + peerIp: Optional[str] = None + """ + IP address of the peer VPN gateway. Only IPv4 is supported. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + """ + region: Optional[str] = None + """ + The region where the tunnel is located. If unset, is set to the region of target_vpn_gateway. + """ + remoteTrafficSelector: Optional[List[str]] = None + """ + Remote traffic selector to use when establishing the VPN tunnel with + peer VPN gateway. The value should be a CIDR formatted string, + for example 192.168.0.0/16. The ranges should be disjoint. + Only IPv4 is supported. + """ + router: Optional[str] = None + """ + URL of router resource to be used for dynamic routing. + """ + selfLink: Optional[str] = None + """ + The URI of the created resource. + """ + sharedSecretHash: Optional[str] = None + """ + Hash of the shared secret. + """ + targetVpnGateway: Optional[str] = None + """ + URL of the Target VPN gateway with which this VPN tunnel is + associated. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource + and default labels configured on the provider. + """ + tunnelId: Optional[str] = None + """ + The unique identifier for the resource. This identifier is defined by the server. + """ + vpnGateway: Optional[str] = None + """ + URL of the VPN gateway with which this VPN tunnel is associated. + This must be used if a High Availability VPN gateway resource is created. + This field must reference a google_compute_ha_vpn_gateway resource. + """ + vpnGatewayInterface: Optional[float] = None + """ + The interface ID of the VPN gateway with which this VPN tunnel is associated. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class VPNTunnel(BaseModel): + apiVersion: Optional[Literal['compute.gcp.m.upbound.io/v1beta1']] = ( + 'compute.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['VPNTunnel']] = 'VPNTunnel' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + VPNTunnelSpec defines the desired state of VPNTunnel + """ + status: Optional[Status] = None + """ + VPNTunnelStatus defines the observed state of VPNTunnel. + """ + + +class VPNTunnelList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[VPNTunnel] + """ + List of vpntunnels. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/container/__init__.py b/schemas/python/models/io/upbound/m/gcp/container/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/container/cluster/__init__.py b/schemas/python/models/io/upbound/m/gcp/container/cluster/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/container/cluster/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/container/cluster/v1beta1.py new file mode 100644 index 000000000..89c73866d --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/container/cluster/v1beta1.py @@ -0,0 +1,4008 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_m_upbound_io_v1beta1_cluster.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class CloudrunConfig(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + loadBalancerType: Optional[str] = None + """ + The load balancer type of CloudRun ingress service. It is external load balancer by default. + Set load_balancer_type=LOAD_BALANCER_TYPE_INTERNAL to configure it as internal load balancer. + """ + + +class ConfigConnectorConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class DnsCacheConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcePersistentDiskCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcpFilestoreCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcsFuseCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GkeBackupAgentConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class HorizontalPodAutoscaling(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class HttpLoadBalancing(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class LustreCsiDriverConfig(BaseModel): + enableLegacyLustrePort: Optional[bool] = None + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class NetworkPolicyConfig(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class ParallelstoreCsiDriverConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayClusterLoggingConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayClusterMonitoringConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class RayOperatorConfigItem(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + rayClusterLoggingConfig: Optional[RayClusterLoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + rayClusterMonitoringConfig: Optional[RayClusterMonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + + +class StatefulHaConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class AddonsConfig(BaseModel): + cloudrunConfig: Optional[CloudrunConfig] = None + """ + . Structure is documented below. + """ + configConnectorConfig: Optional[ConfigConnectorConfig] = None + """ + . + The status of the ConfigConnector addon. It is disabled by default; Set enabled = true to enable. + """ + dnsCacheConfig: Optional[DnsCacheConfig] = None + """ + . + The status of the NodeLocal DNSCache addon. It is disabled by default. + Set enabled = true to enable. + """ + gcePersistentDiskCsiDriverConfig: Optional[GcePersistentDiskCsiDriverConfig] = None + """ + . + Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Set enabled = true to enable. + """ + gcpFilestoreCsiDriverConfig: Optional[GcpFilestoreCsiDriverConfig] = None + """ + The status of the Filestore CSI driver addon, + which allows the usage of filestore instance as volumes. + It is disabled by default; set enabled = true to enable. + """ + gcsFuseCsiDriverConfig: Optional[GcsFuseCsiDriverConfig] = None + """ + The status of the GCSFuse CSI driver addon, + which allows the usage of a gcs bucket as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is enabled by default for Autopilot clusters with version 1.24 or later; set enabled = true to enable it explicitly. + See Enable the Cloud Storage FUSE CSI driver for more information. + """ + gkeBackupAgentConfig: Optional[GkeBackupAgentConfig] = None + """ + . + The status of the Backup for GKE agent addon. It is disabled by default; Set enabled = true to enable. + """ + horizontalPodAutoscaling: Optional[HorizontalPodAutoscaling] = None + """ + The status of the Horizontal Pod Autoscaling + addon, which increases or decreases the number of replica pods a replication controller + has based on the resource usage of the existing pods. + It is enabled by default; + set disabled = true to disable. + """ + httpLoadBalancing: Optional[HttpLoadBalancing] = None + """ + The status of the HTTP (L7) load balancing + controller addon, which makes it easy to set up HTTP load balancers for services in a + cluster. It is enabled by default; set disabled = true to disable. + """ + lustreCsiDriverConfig: Optional[LustreCsiDriverConfig] = None + """ + The status of the Lustre CSI driver addon, + which allows the usage of a Lustre instances as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is disabled by default for Autopilot clusters; set enabled = true to enable. + Lustre CSI Driver Config has optional subfield + enable_legacy_lustre_port which allows the Lustre CSI driver to initialize LNet (the virtual networklayer for Lustre kernel module) using port 6988. + This flag is required to workaround a port conflict with the gke-metadata-server on GKE nodes. + See Enable Lustre CSI driver for more information. + """ + networkPolicyConfig: Optional[NetworkPolicyConfig] = None + """ + Whether we should enable the network policy addon + for the master. This must be enabled in order to enable network policy for the nodes. + To enable this, you must also define a network_policy block, + otherwise nothing will happen. + It can only be disabled if the nodes already do not have network policies enabled. + Defaults to disabled; set disabled = false to enable. + """ + parallelstoreCsiDriverConfig: Optional[ParallelstoreCsiDriverConfig] = None + """ + The status of the Parallelstore CSI driver addon, + which allows the usage of a Parallelstore instances as volumes. + It is disabled by default for Standard clusters; set enabled = true to enable. + It is enabled by default for Autopilot clusters with version 1.29 or later; set enabled = true to enable it explicitly. + See Enable the Parallelstore CSI driver for more information. + """ + rayOperatorConfig: Optional[List[RayOperatorConfigItem]] = None + """ + . The status of the Ray Operator + addon. + It is disabled by default. Set enabled = true to enable. The minimum + cluster version to enable Ray is 1.30.0-gke.1747000. + """ + statefulHaConfig: Optional[StatefulHaConfig] = None + """ + . + The status of the Stateful HA addon, which provides automatic configurable failover for stateful applications. + It is disabled by default for Standard clusters. Set enabled = true to enable. + """ + + +class AnonymousAuthenticationConfig(BaseModel): + mode: Optional[str] = None + """ + Sets or removes authentication restrictions. Available options include LIMITED and ENABLED. + """ + + +class AuthenticatorGroupsConfig(BaseModel): + securityGroup: Optional[str] = None + """ + The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com. + """ + + +class BinaryAuthorization(BaseModel): + enabled: Optional[bool] = None + """ + (DEPRECATED) Enable Binary Authorization for this cluster. Deprecated in favor of evaluation_mode. + """ + evaluationMode: Optional[str] = None + """ + Mode of operation for Binary Authorization policy evaluation. Valid values are DISABLED + and PROJECT_SINGLETON_POLICY_ENFORCE. + """ + + +class Management(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + """ + Defines if the instance has integrity monitoring enabled. + """ + enableSecureBoot: Optional[bool] = None + """ + Defines if the instance has Secure Boot enabled. + """ + + +class StandardRolloutPolicy(BaseModel): + batchNodeCount: Optional[float] = None + """ + Number of blue nodes to drain in a batch. Only one of the batch_percentage or batch_node_count can be specified. + """ + batchPercentage: Optional[float] = None + """ + : Percentage of the bool pool nodes to drain in a batch. The range of this field should be (0.0, 1.0). Only one of the batch_percentage or batch_node_count can be specified. + """ + batchSoakDuration: Optional[str] = None + """ + Soak time after each batch gets drained. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".`. + """ + + +class BlueGreenSettings(BaseModel): + nodePoolSoakDuration: Optional[str] = None + """ + Time needed after draining entire blue pool. After this period, blue pool will be cleaned up. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s". + """ + standardRolloutPolicy: Optional[StandardRolloutPolicy] = None + """ + green upgrade. To be specified when strategy is set to BLUE_GREEN. Structure is documented below. + """ + + +class UpgradeSettings(BaseModel): + blueGreenSettings: Optional[BlueGreenSettings] = None + """ + Settings for blue-green upgrade strategy. To be specified when strategy is set to BLUE_GREEN. Structure is documented below. + """ + maxSurge: Optional[float] = None + """ + The maximum number of nodes that can be created beyond the current size of the node pool during the upgrade process. To be used when strategy is set to SURGE. Default is 0. + """ + maxUnavailable: Optional[float] = None + """ + The maximum number of nodes that can be simultaneously unavailable during the upgrade process. To be used when strategy is set to SURGE. Default is 0. + """ + strategy: Optional[str] = None + """ + Strategy used for node pool update. Strategy can only be one of BLUE_GREEN or SURGE. The default is value is SURGE. + """ + + +class AutoProvisioningDefaults(BaseModel): + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + diskSize: Optional[float] = None + """ + Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. Defaults to 100 + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + management: Optional[Management] = None + """ + NodeManagement configuration for this NodePool. Structure is documented below. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specifies the upgrade settings for NAP created node pools. Structure is documented below. + """ + + +class ResourceLimit(BaseModel): + maximum: Optional[float] = None + """ + Maximum amount of the resource in the cluster. + """ + minimum: Optional[float] = None + """ + Minimum amount of the resource in the cluster. + """ + resourceType: Optional[str] = None + """ + The type of the resource. For example, cpu and + memory. See the guide to using Node Auto-Provisioning + for a list of types. + """ + + +class ClusterAutoscaling(BaseModel): + autoProvisioningDefaults: Optional[AutoProvisioningDefaults] = None + """ + Contains defaults for a node pool created by NAP. A subset of fields also apply to + GKE Autopilot clusters. + Structure is documented below. + """ + autoProvisioningLocations: Optional[List[str]] = None + """ + The list of Google Compute Engine + zones in which the + NodePool's nodes can be created by NAP. + """ + autoscalingProfile: Optional[str] = None + """ + Configuration + options for the Autoscaling profile + feature, which lets you choose whether the cluster autoscaler should optimize for resource utilization or resource availability + when deciding to remove nodes from a cluster. Can be BALANCED or OPTIMIZE_UTILIZATION. Defaults to BALANCED. + """ + enabled: Optional[bool] = None + """ + Whether node auto-provisioning is enabled. Must be supplied for GKE Standard clusters, true is implied + for autopilot clusters. Resource limits for cpu and memory must be defined to enable node auto-provisioning for GKE Standard. + """ + resourceLimits: Optional[List[ResourceLimit]] = None + """ + Global constraints for machine resources in the + cluster. Configuring the cpu and memory types is required if node + auto-provisioning is enabled. These limits will apply to node pool autoscaling + in addition to node auto-provisioning. Structure is documented below. + """ + + +class ConfidentialNodes(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class DnsEndpointConfig(BaseModel): + allowExternalTraffic: Optional[bool] = None + """ + Controls whether user traffic is allowed over this endpoint. Note that GCP-managed services may still use the endpoint even if this is false. + """ + endpoint: Optional[str] = None + """ + (Output) The cluster's DNS endpoint. + """ + + +class IpEndpointsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Controls whether to allow direct IP access. Defaults to true. + """ + + +class ControlPlaneEndpointsConfig(BaseModel): + dnsEndpointConfig: Optional[DnsEndpointConfig] = None + """ + DNS endpoint configuration. + """ + ipEndpointsConfig: Optional[IpEndpointsConfig] = None + """ + IP endpoint configuration. + """ + + +class CostManagementConfig(BaseModel): + enabled: Optional[bool] = None + """ + Whether to enable the cost allocation feature. + """ + + +class DatabaseEncryption(BaseModel): + keyName: Optional[str] = None + """ + the key to use to encrypt/decrypt secrets. See the DatabaseEncryption definition for more information. + """ + state: Optional[str] = None + """ + ENCRYPTED or DECRYPTED + """ + + +class DefaultSnatStatus(BaseModel): + disabled: Optional[bool] = None + """ + Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when defaultSnatStatus is disabled.When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic + """ + + +class DnsConfig(BaseModel): + additiveVpcScopeDnsDomain: Optional[str] = None + """ + This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = "CLOUD_DNS" and cluster_dns_scope = "CLUSTER_SCOPE" must both be set as well. + """ + clusterDns: Optional[str] = None + """ + Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS. + """ + clusterDnsDomain: Optional[str] = None + """ + The suffix used for all cluster service records. + """ + clusterDnsScope: Optional[str] = None + """ + The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED or CLUSTER_SCOPE or VPC_SCOPE. If the cluster_dns field is set to CLOUD_DNS, DNS_SCOPE_UNSPECIFIED and empty/null behave like CLUSTER_SCOPE. + """ + + +class EnableK8SBetaApis(BaseModel): + enabledApis: Optional[List[str]] = None + """ + Enabled Kubernetes Beta APIs. To list a Beta API resource, use the representation {group}/{version}/{resource}. The version must be a Beta version. Note that you cannot disable beta APIs that are already enabled on a cluster without recreating it. See the Configure beta APIs for more information. + """ + + +class EnterpriseConfig(BaseModel): + desiredTier: Optional[str] = None + """ + Sets the tier of the cluster. Available options include STANDARD and ENTERPRISE. + """ + + +class Fleet(BaseModel): + project: Optional[str] = None + """ + The name of the Fleet host project where this cluster will be registered. + """ + + +class GatewayApiConfig(BaseModel): + channel: Optional[str] = None + """ + Which Gateway Api channel should be used. CHANNEL_DISABLED, CHANNEL_EXPERIMENTAL or CHANNEL_STANDARD. + """ + + +class GkeAutoUpgradeConfig(BaseModel): + patchMode: Optional[str] = None + """ + The selected patch mode. + Accepted values are: + """ + + +class IdentityServiceConfig(BaseModel): + enabled: Optional[bool] = None + """ + Whether to enable the Identity Service component. It is disabled by default. Set enabled=true to enable. + """ + + +class AdditionalIpRangesConfigItem(BaseModel): + podIpv4RangeNames: Optional[List[str]] = None + """ + List of secondary ranges names within this subnetwork that can be used for pod IPs. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class AdditionalPodRangesConfig(BaseModel): + podRangeNames: Optional[List[str]] = None + """ + The names of the Pod ranges to add to the cluster. + """ + + +class PodCidrOverprovisionConfig(BaseModel): + disabled: Optional[bool] = None + """ + The status of the Istio addon, which makes it easy to set up Istio for services in a + cluster. It is disabled by default. Set disabled = false to enable. + """ + + +class IpAllocationPolicy(BaseModel): + additionalIpRangesConfig: Optional[List[AdditionalIpRangesConfigItem]] = None + """ + The configuration for individual additional subnetworks attached to the cluster. + Structure is documented below. + """ + additionalPodRangesConfig: Optional[AdditionalPodRangesConfig] = None + """ + The configuration for additional pod secondary ranges at + the cluster level. Used for Autopilot clusters and Standard clusters with which control of the + secondary Pod IP address assignment to node pools isn't needed. Structure is documented below. + """ + clusterIpv4CidrBlock: Optional[str] = None + """ + The IP address range for the cluster pod IPs. + Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) + to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) + from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to + pick a specific range to use. + """ + clusterSecondaryRangeName: Optional[str] = None + """ + The name of the existing secondary + range in the cluster's subnetwork to use for pod IP addresses. Alternatively, + cluster_ipv4_cidr_block can be used to automatically create a GKE-managed one. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + servicesIpv4CidrBlock: Optional[str] = None + """ + The IP address range of the services IPs in this cluster. + Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) + to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) + from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to + pick a specific range to use. + """ + servicesSecondaryRangeName: Optional[str] = None + """ + The name of the existing + secondary range in the cluster's subnetwork to use for service ClusterIPs. + Alternatively, services_ipv4_cidr_block can be used to automatically create a + GKE-managed one. + """ + stackType: Optional[str] = None + """ + The IP Stack Type of the cluster. + Default value is IPV4. + Possible values are IPV4 and IPV4_IPV6. + """ + + +class LoggingConfig(BaseModel): + enableComponents: Optional[List[str]] = None + """ + The GKE components exposing logs. Supported values include: + SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. + """ + + +class DailyMaintenanceWindow(BaseModel): + startTime: Optional[str] = None + + +class ExclusionOptions(BaseModel): + scope: Optional[str] = None + """ + Whether or not to enable GKE Auto-Monitoring. Supported values include: ALL, NONE. + """ + + +class MaintenanceExclusionItem(BaseModel): + endTime: Optional[str] = None + exclusionName: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + exclusionOptions: Optional[ExclusionOptions] = None + """ + MaintenanceExclusionOptions provides maintenance exclusion related options. + """ + startTime: Optional[str] = None + + +class RecurringWindow(BaseModel): + endTime: Optional[str] = None + recurrence: Optional[str] = None + startTime: Optional[str] = None + + +class MaintenancePolicy(BaseModel): + dailyMaintenanceWindow: Optional[DailyMaintenanceWindow] = None + """ + structure documented below. + """ + maintenanceExclusion: Optional[List[MaintenanceExclusionItem]] = None + """ + structure documented below + """ + recurringWindow: Optional[RecurringWindow] = None + """ + structure documented below + """ + + +class ClientCertificateConfig(BaseModel): + issueClientCertificate: Optional[bool] = None + + +class MasterAuth(BaseModel): + clientCertificateConfig: Optional[ClientCertificateConfig] = None + """ + Whether client certificate authorization is enabled for this cluster. For example: + """ + + +class CidrBlock(BaseModel): + cidrBlock: Optional[str] = None + """ + External network that can access Kubernetes master through HTTPS. + Must be specified in CIDR notation. + """ + displayName: Optional[str] = None + """ + Field for users to identify CIDR blocks. + """ + + +class MasterAuthorizedNetworksConfig(BaseModel): + cidrBlocks: Optional[List[CidrBlock]] = None + """ + External networks that can access the + Kubernetes cluster master through HTTPS. + """ + gcpPublicCidrsAccessEnabled: Optional[bool] = None + """ + Whether Kubernetes master is + accessible via Google Compute Engine Public IPs. + """ + privateEndpointEnforcementEnabled: Optional[bool] = None + """ + Whether authorized networks is enforced on the private endpoint or not. + """ + + +class MeshCertificates(BaseModel): + enableCertificates: Optional[bool] = None + """ + Controls the issuance of workload mTLS certificates. It is enabled by default. Workload Identity is required, see workload_config. + """ + + +class AdvancedDatapathObservabilityConfig(BaseModel): + enableMetrics: Optional[bool] = None + """ + Whether or not to enable advanced datapath metrics. + """ + enableRelay: Optional[bool] = None + """ + Whether or not Relay is enabled. + """ + + +class AutoMonitoringConfig(BaseModel): + scope: Optional[str] = None + """ + Whether or not to enable GKE Auto-Monitoring. Supported values include: ALL, NONE. + """ + + +class ManagedPrometheus(BaseModel): + autoMonitoringConfig: Optional[AutoMonitoringConfig] = None + """ + Configuration options for GKE Auto-Monitoring. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class MonitoringConfig(BaseModel): + advancedDatapathObservabilityConfig: Optional[ + AdvancedDatapathObservabilityConfig + ] = None + """ + Configuration for Advanced Datapath Monitoring. Structure is documented below. + """ + enableComponents: Optional[List[str]] = None + """ + The GKE components exposing metrics. Supported values include: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR, DCGM and JOBSET. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. JOBSET is only supported in GKE 1.32.1-gke.1357001 and above. + """ + managedPrometheus: Optional[ManagedPrometheus] = None + """ + Configuration for Managed Service for Prometheus. Structure is documented below. + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + Specifies the total network bandwidth tier for NodePools in the cluster. + """ + + +class NetworkPolicy(BaseModel): + enabled: Optional[bool] = None + """ + Whether network policy is enabled on the cluster. + """ + provider: Optional[str] = None + """ + The selected network policy provider. Defaults to PROVIDER_UNSPECIFIED. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class NetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class NetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + """ + Defines whether the instance should have nested virtualization enabled. Defaults to false. + """ + performanceMonitoringUnit: Optional[str] = None + """ + Defines the performance monitoring unit PMU level. Valid values are ARCHITECTURAL, STANDARD, or ENHANCED. Defaults to off. + """ + threadsPerCore: Optional[float] = None + """ + The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + """ + + +class ConfidentialNodesModel(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcpSecretManagerCertificateConfig(BaseModel): + secretUri: Optional[str] = None + + +class CertificateAuthorityDomainConfigItem(BaseModel): + fqdns: Optional[List[str]] = None + gcpSecretManagerCertificateConfig: Optional[GcpSecretManagerCertificateConfig] = ( + None + ) + + +class PrivateRegistryAccessConfig(BaseModel): + certificateAuthorityDomainConfig: Optional[ + List[CertificateAuthorityDomainConfigItem] + ] = None + """ + List of configuration objects for CA and domains. Each object identifies a certificate and its assigned domains. See how to configure for private container registries for more detail. Example: + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class ContainerdConfig(BaseModel): + privateRegistryAccessConfig: Optional[PrivateRegistryAccessConfig] = None + """ + Configuration for private container registries. There are two fields in this config: + """ + + +class EphemeralStorageLocalSsdConfig(BaseModel): + dataCacheCount: Optional[float] = None + """ + Number of raw-block local NVMe SSD disks to be attached to the node utilized for GKE Data Cache. If zero, then GKE Data Cache will not be enabled in the nodes. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + + +class FastSocket(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GcfsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class GpuDriverInstallationConfig(BaseModel): + gpuDriverVersion: Optional[str] = None + """ + Mode for how the GPU driver is installed. + Accepted values are: + """ + + +class GpuSharingConfig(BaseModel): + gpuSharingStrategy: Optional[str] = None + """ + The type of GPU sharing strategy to enable on the GPU node. + Accepted values are: + """ + maxSharedClientsPerGpu: Optional[float] = None + """ + The maximum number of containers that can share a GPU. + """ + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + """ + The number of the guest accelerator cards exposed to this instance. + """ + gpuDriverInstallationConfig: Optional[GpuDriverInstallationConfig] = None + """ + Configuration for auto installation of GPU driver. Structure is documented below. + """ + gpuPartitionSize: Optional[str] = None + """ + Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide. + """ + gpuSharingConfig: Optional[GpuSharingConfig] = None + """ + Configuration for GPU sharing. Structure is documented below. + """ + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class Gvnic(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class HostMaintenancePolicy(BaseModel): + maintenanceInterval: Optional[str] = None + + +class KubeletConfig(BaseModel): + allowedUnsafeSysctls: Optional[List[str]] = None + """ + Defines a comma-separated allowlist of unsafe sysctls or sysctl patterns which can be set on the Pods. The allowed sysctl groups are kernel.shm*, kernel.msg*, kernel.sem, fs.mqueue.*, and net.*. + """ + containerLogMaxFiles: Optional[float] = None + """ + Defines the maximum number of container log files that can be present for a container. The integer must be between 2 and 10, inclusive. + """ + containerLogMaxSize: Optional[str] = None + """ + Defines the maximum size of the + container log file before it is rotated. Specified as a positive number and a + unit suffix, such as "100Ki", "10Mi". Valid units are "Ki", "Mi", "Gi". + The value must be between "10Mi" and "500Mi", inclusive. And the total container log size + (container_log_max_size * container_log_max_files) cannot exceed 1% of the total storage of the node. + """ + cpuCfsQuota: Optional[bool] = None + """ + If true, enables CPU CFS quota enforcement for + containers that specify CPU limits. + """ + cpuCfsQuotaPeriod: Optional[str] = None + """ + The CPU CFS quota period value. Specified + as a sequence of decimal numbers, each with optional fraction and a unit suffix, + such as "300ms". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", + "h". The value must be a positive duration. + """ + cpuManagerPolicy: Optional[str] = None + """ + The CPU management policy on the node. See + K8S CPU Management Policies. + One of "none" or "static". If unset (or set to the empty string ""), the API will treat the field as if set to "none". + Prior to the 6.4.0 this field was marked as required. The workaround for the required field + is setting the empty string "", which will function identically to not setting this field. + """ + imageGcHighThresholdPercent: Optional[float] = None + """ + Defines the percent of disk usage after which image garbage collection is always run. The integer must be between 10 and 85, inclusive. + """ + imageGcLowThresholdPercent: Optional[float] = None + """ + Defines the percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. The integer must be between 10 and 85, inclusive. + """ + imageMaximumGcAge: Optional[str] = None + """ + Defines the maximum age an image can be unused before it is garbage collected. Specified as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300s", "1.5m", and "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". The value must be a positive duration. + """ + imageMinimumGcAge: Optional[str] = None + """ + Defines the minimum age for an unused image before it is garbage collected. Specified as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300s", "1.5m". The value cannot be greater than "2m". + """ + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + podPidsLimit: Optional[float] = None + """ + Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. + """ + + +class HugepagesConfig(BaseModel): + hugepageSize1G: Optional[float] = None + """ + Amount of 1G hugepages. + """ + hugepageSize2M: Optional[float] = None + """ + Amount of 2M hugepages. + """ + + +class LinuxNodeConfig(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[HugepagesConfig] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class LocalNvmeSsdBlockConfig(BaseModel): + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + + +class ReservationAffinity(BaseModel): + consumeReservationType: Optional[str] = None + """ + The type of reservation consumption + Accepted values are: + """ + key: Optional[str] = None + """ + Key for taint. + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SecondaryBootDisk(BaseModel): + diskImage: Optional[str] = None + """ + Path to disk image to create the secondary boot disk from. After using the gke-disk-image-builder, this argument should be global/images/DISK_IMAGE_NAME. + """ + mode: Optional[str] = None + """ + How to expose the node metadata to the workload running on the node. + Accepted values are: + """ + + +class ServiceAccountRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class NodeAffinityItem(BaseModel): + key: Optional[str] = None + """ + Key for taint. + """ + operator: Optional[str] = None + """ + Specifies affinity or anti-affinity. Accepted values are "IN" or "NOT_IN" + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SoleTenantConfig(BaseModel): + nodeAffinity: Optional[List[NodeAffinityItem]] = None + + +class TaintItem(BaseModel): + effect: Optional[str] = None + """ + Effect for taint. Accepted values are NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE. + """ + key: Optional[str] = None + """ + Key for taint. + """ + value: Optional[str] = None + """ + Value for taint. + """ + + +class WindowsNodeConfig(BaseModel): + osversion: Optional[str] = None + + +class WorkloadMetadataConfig(BaseModel): + mode: Optional[str] = None + """ + How to expose the node metadata to the workload running on the node. + Accepted values are: + """ + + +class NodeConfig(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[ConfidentialNodesModel] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[FastSocket] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + Parameters for the Google Container Filesystem (GCFS). + If unspecified, GCFS will not be enabled on the node pool. When enabling this feature you must specify image_type = "COS_CONTAINERD" and node_version from GKE versions 1.19 or later to use it. + For GKE versions 1.19, 1.20, and 1.21, the recommended minimum node_version would be 1.19.15-gke.1300, 1.20.11-gke.1300, and 1.21.5-gke.1300 respectively. + A machine_type that has more than 16 GiB of memory is also recommended. + GCFS must be enabled in order to use image streaming. + Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[Gvnic] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[KubeletConfig] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[LinuxNodeConfig] = None + """ + Parameters that can be configured on Linux nodes. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + wide default value. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCP labels (key/value pairs) to be applied to each node. Refer here + for how these labels are applied to clusters, node pools and nodes. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + serviceAccountRef: Optional[ServiceAccountRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccount. + """ + serviceAccountSelector: Optional[ServiceAccountSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccount. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[SoleTenantConfig] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class LinuxNodeConfigModel(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class NetworkTags(BaseModel): + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + + +class NodeKubeletConfig(BaseModel): + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + + +class NodePoolAutoConfig(BaseModel): + linuxNodeConfig: Optional[LinuxNodeConfigModel] = None + """ + Linux system configuration for the cluster's automatically provisioned node pools. Only cgroup_mode field is supported in node_pool_auto_config. Structure is documented below. + """ + networkTags: Optional[NetworkTags] = None + """ + The network tag config for the cluster's automatically provisioned node pools. Structure is documented below. + """ + nodeKubeletConfig: Optional[NodeKubeletConfig] = None + """ + Kubelet configuration for Autopilot clusters. Currently, only insecure_kubelet_readonly_port_enabled is supported here. + Structure is documented below. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + + +class NodeConfigDefaults(BaseModel): + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable image streaming across all the node pools within the cluster. Structure is documented below. + """ + insecureKubeletReadonlyPortEnabled: Optional[str] = None + """ + only port is enabled for newly created node pools in the cluster. It is strongly recommended to set this to FALSE. Possible values: TRUE, FALSE. + """ + loggingVariant: Optional[str] = None + """ + The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + + +class NodePoolDefaults(BaseModel): + nodeConfigDefaults: Optional[NodeConfigDefaults] = None + """ + Subset of NodeConfig message that has defaults. + """ + + +class Filter(BaseModel): + eventType: Optional[List[str]] = None + """ + Can be used to filter what notifications are sent. Accepted values are UPGRADE_AVAILABLE_EVENT, UPGRADE_EVENT, SECURITY_BULLETIN_EVENT and UPGRADE_INFO_EVENT. See Filtering notifications for more details. + """ + + +class Pubsub(BaseModel): + enabled: Optional[bool] = None + """ + Whether or not the notification config is enabled + """ + filter: Optional[Filter] = None + """ + Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Structure is documented below. + """ + topic: Optional[str] = None + """ + The pubsub topic to push upgrade notifications to. Must be in the same project as the cluster. Must be in the format: projects/{project}/topics/{topic}. + """ + + +class NotificationConfig(BaseModel): + pubsub: Optional[Pubsub] = None + """ + The pubsub config for the cluster's upgrade notifications. + """ + + +class PodAutoscaling(BaseModel): + hpaProfile: Optional[str] = None + """ + Enable the Horizontal Pod Autoscaling profile for this cluster. + Acceptable values are: + """ + + +class MasterGlobalAccessConfig(BaseModel): + enabled: Optional[bool] = None + """ + Whether the cluster master is accessible globally or + not. + """ + + +class PrivateEndpointSubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class PrivateEndpointSubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class PrivateClusterConfig(BaseModel): + enablePrivateEndpoint: Optional[bool] = None + """ + When true, the cluster's private + endpoint is used as the cluster endpoint and access through the public endpoint + is disabled. When false, either endpoint can be used. This field only applies + to private clusters, when enable_private_nodes is true. + """ + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + masterGlobalAccessConfig: Optional[MasterGlobalAccessConfig] = None + """ + Controls cluster master global + access settings. Structure is documented below. + """ + masterIpv4CidrBlock: Optional[str] = None + """ + The IP range in CIDR notation to use for + the hosted master network. This range will be used for assigning private IP + addresses to the cluster master(s) and the ILB VIP. This range must not overlap + with any other ranges in use within the cluster's network, and it must be a /28 + subnet. See Private Cluster Limitations + for more details. This field only applies to private clusters, when + enable_private_nodes is true. + """ + privateEndpointSubnetwork: Optional[str] = None + """ + Subnetwork in cluster's network where master's endpoint will be provisioned. + """ + privateEndpointSubnetworkRef: Optional[PrivateEndpointSubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate privateEndpointSubnetwork. + """ + privateEndpointSubnetworkSelector: Optional[PrivateEndpointSubnetworkSelector] = ( + None + ) + """ + Selector for a Subnetwork in compute to populate privateEndpointSubnetwork. + """ + + +class RbacBindingConfig(BaseModel): + enableInsecureBindingSystemAuthenticated: Optional[bool] = None + """ + Setting this to true will allow any ClusterRoleBinding and RoleBinding with subjects system:authenticated. + """ + enableInsecureBindingSystemUnauthenticated: Optional[bool] = None + """ + Setting this to true will allow any ClusterRoleBinding and RoleBinding with subjects system:anonymous or system:unauthenticated. + """ + + +class ReleaseChannel(BaseModel): + channel: Optional[str] = None + """ + The selected release channel. + Accepted values are: + """ + + +class BigqueryDestination(BaseModel): + datasetId: Optional[str] = None + """ + The ID of a BigQuery Dataset. For Example: + """ + + +class ResourceUsageExportConfig(BaseModel): + bigqueryDestination: Optional[BigqueryDestination] = None + """ + Parameters for using BigQuery as the destination of resource usage export. + """ + enableNetworkEgressMetering: Optional[bool] = None + """ + Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created + in the cluster to meter network egress traffic. + """ + enableResourceConsumptionMetering: Optional[bool] = None + """ + Whether to enable resource + consumption metering on this cluster. When enabled, a table will be created in + the resource export BigQuery dataset to store resource consumption data. The + resulting table can be joined with the resource usage table or with BigQuery + billing export. Defaults to true. + """ + + +class SecretManagerConfig(BaseModel): + enabled: Optional[bool] = None + """ + Enable the Secret Manager add-on for this cluster. + """ + + +class SecurityPostureConfig(BaseModel): + mode: Optional[str] = None + """ + Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include DISABLED, BASIC, and ENTERPRISE. + """ + vulnerabilityMode: Optional[str] = None + """ + Sets the mode of the Kubernetes security posture API's workload vulnerability scanning. Available options include VULNERABILITY_DISABLED, VULNERABILITY_BASIC and VULNERABILITY_ENTERPRISE. + """ + + +class ServiceExternalIpsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Controls whether external ips specified by a service will be allowed. It is enabled by default. + """ + + +class SubnetworkRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class SubnetworkSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class UserManagedKeysConfig(BaseModel): + aggregationCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the aggreation CA in this cluster. + """ + clusterCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the cluster CA in this cluster. + """ + controlPlaneDiskEncryptionKey: Optional[str] = None + """ + The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control plane nodes. + """ + etcdApiCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the etcd API CA in this cluster. + """ + etcdPeerCa: Optional[str] = None + """ + The Certificate Authority Service caPool to use for the etcd peer CA in this cluster. + """ + gkeopsEtcdBackupEncryptionKey: Optional[str] = None + """ + Resource path of the Cloud KMS cryptoKey to use for encryption of internal etcd backups. + """ + serviceAccountSigningKeys: Optional[List[str]] = None + """ + The Cloud KMS cryptoKeyVersions to use for signing service account JWTs issued by this cluster. + """ + serviceAccountVerificationKeys: Optional[List[str]] = None + """ + The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs issued by this cluster. + """ + + +class VerticalPodAutoscaling(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class WorkloadIdentityConfig(BaseModel): + workloadPool: Optional[str] = None + """ + The workload pool to attach all Kubernetes service accounts to. + """ + + +class ForProvider(BaseModel): + addonsConfig: Optional[AddonsConfig] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[AnonymousAuthenticationConfig] = None + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[AuthenticatorGroupsConfig] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[BinaryAuthorization] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[ClusterAutoscaling] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[ConfidentialNodes] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[ControlPlaneEndpointsConfig] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[CostManagementConfig] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[DatabaseEncryption] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[DefaultSnatStatus] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[DnsConfig] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[EnableK8SBetaApis] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + enterpriseConfig: Optional[EnterpriseConfig] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[Fleet] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[GatewayApiConfig] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[GkeAutoUpgradeConfig] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + identityServiceConfig: Optional[IdentityServiceConfig] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[IpAllocationPolicy] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + location: str + """ + The location (region or zone) in which the cluster + master will be created, as well as the default node location. If you specify a + zone (such as us-central1-a), the cluster will be a zonal cluster with a + single cluster master. If you specify a region (such as us-west1), the + cluster will be a regional cluster with multiple masters spread across zones in + the region, and with default node locations in those zones as well + """ + loggingConfig: Optional[LoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[MaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[MasterAuth] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[MasterAuthorizedNetworksConfig] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + meshCertificates: Optional[MeshCertificates] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[MonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[NetworkPolicy] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePoolAutoConfig: Optional[NodePoolAutoConfig] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[NodePoolDefaults] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[NotificationConfig] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + podAutoscaling: Optional[PodAutoscaling] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[PrivateClusterConfig] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[RbacBindingConfig] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[ReleaseChannel] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[ResourceUsageExportConfig] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[SecretManagerConfig] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[SecurityPostureConfig] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + serviceExternalIpsConfig: Optional[ServiceExternalIpsConfig] = None + """ + Structure is documented below. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + userManagedKeysConfig: Optional[UserManagedKeysConfig] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[VerticalPodAutoscaling] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[WorkloadIdentityConfig] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class ConfidentialNodesModel1(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class ConfidentialNodesModel2(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class LinuxNodeConfigModel1(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[HugepagesConfig] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class LinuxNodeConfigModel2(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class InitProvider(BaseModel): + addonsConfig: Optional[AddonsConfig] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[AnonymousAuthenticationConfig] = None + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[AuthenticatorGroupsConfig] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[BinaryAuthorization] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[ClusterAutoscaling] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[ConfidentialNodesModel1] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[ControlPlaneEndpointsConfig] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[CostManagementConfig] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[DatabaseEncryption] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[DefaultSnatStatus] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[DnsConfig] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[EnableK8SBetaApis] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + enterpriseConfig: Optional[EnterpriseConfig] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[Fleet] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[GatewayApiConfig] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[GkeAutoUpgradeConfig] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + identityServiceConfig: Optional[IdentityServiceConfig] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[IpAllocationPolicy] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + loggingConfig: Optional[LoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[MaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[MasterAuth] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[MasterAuthorizedNetworksConfig] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + meshCertificates: Optional[MeshCertificates] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[MonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[NetworkPolicy] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkRef: Optional[NetworkRef] = None + """ + Reference to a Network in compute to populate network. + """ + networkSelector: Optional[NetworkSelector] = None + """ + Selector for a Network in compute to populate network. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePoolAutoConfig: Optional[NodePoolAutoConfig] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[NodePoolDefaults] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[NotificationConfig] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + podAutoscaling: Optional[PodAutoscaling] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[PrivateClusterConfig] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[RbacBindingConfig] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[ReleaseChannel] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[ResourceUsageExportConfig] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[SecretManagerConfig] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[SecurityPostureConfig] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + serviceExternalIpsConfig: Optional[ServiceExternalIpsConfig] = None + """ + Structure is documented below. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + subnetworkRef: Optional[SubnetworkRef] = None + """ + Reference to a Subnetwork in compute to populate subnetwork. + """ + subnetworkSelector: Optional[SubnetworkSelector] = None + """ + Selector for a Subnetwork in compute to populate subnetwork. + """ + userManagedKeysConfig: Optional[UserManagedKeysConfig] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[VerticalPodAutoscaling] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[WorkloadIdentityConfig] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class UpgradeOption(BaseModel): + autoUpgradeStartTime: Optional[str] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + + +class ManagementModel(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + upgradeOptions: Optional[List[UpgradeOption]] = None + """ + Specifies the Auto Upgrade knobs for the node pool. + """ + + +class ConfidentialNodesModel3(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enable Confidential GKE Nodes for this node pool, to + enforce encryption of data in-use. + """ + + +class EnterpriseConfigModel(BaseModel): + clusterTier: Optional[str] = None + """ + The effective tier of the cluster. + """ + desiredTier: Optional[str] = None + """ + Sets the tier of the cluster. Available options include STANDARD and ENTERPRISE. + """ + + +class FleetModel(BaseModel): + membership: Optional[str] = None + """ + The resource name of the fleet Membership resource associated to this cluster with format //gkehub.googleapis.com/projects/{{project}}/locations/{{location}}/memberships/{{name}}. See the official doc for fleet management. + """ + membershipId: Optional[str] = None + """ + The short name of the fleet membership, extracted from fleet.0.membership. You can use this field to configure membership_id under google_gkehub_feature_membership. + """ + membershipLocation: Optional[str] = None + """ + The location of the fleet membership, extracted from fleet.0.membership. You can use this field to configure membership_location under google_gkehub_feature_membership. + """ + preRegistered: Optional[bool] = None + project: Optional[str] = None + """ + The name of the Fleet host project where this cluster will be registered. + """ + + +class DailyMaintenanceWindowModel(BaseModel): + duration: Optional[str] = None + """ + Duration of the time window, automatically chosen to be + smallest possible in the given scenario. + Duration will be in RFC3339 format "PTnHnMnS". + """ + startTime: Optional[str] = None + + +class MasterAuthModel(BaseModel): + clientCertificate: Optional[str] = None + """ + Base64 encoded public certificate + used by clients to authenticate to the cluster endpoint. + """ + clientCertificateConfig: Optional[ClientCertificateConfig] = None + """ + Whether client certificate authorization is enabled for this cluster. For example: + """ + clusterCaCertificate: Optional[str] = None + """ + Base64 encoded public certificate + that is the root certificate of the cluster. + """ + + +class ConfidentialNodesModel4(BaseModel): + confidentialInstanceType: Optional[str] = None + """ + Defines the type of technology used + by the confidential node. + """ + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class EffectiveTaint(BaseModel): + effect: Optional[str] = None + """ + Effect for taint. Accepted values are NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE. + """ + key: Optional[str] = None + """ + Key for taint. + """ + value: Optional[str] = None + """ + Value for taint. + """ + + +class LinuxNodeConfigModel3(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + hugepagesConfig: Optional[HugepagesConfig] = None + """ + Amounts for 2M and 1G hugepages. Structure is documented below. + """ + sysctls: Optional[Dict[str, str]] = None + """ + The Linux kernel parameters to be applied to the nodes + and all pods running on the nodes. Specified as a map from the key, such as + net.core.wmem_max, to a string value. Currently supported attributes can be found here. + Note that validations happen all server side. All attributes are optional. + """ + + +class NodeConfigModel(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[ConfidentialNodesModel4] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + effectiveTaints: Optional[List[EffectiveTaint]] = None + """ + List of kubernetes taints applied to each node. Structure is documented above. + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[FastSocket] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + Parameters for the Google Container Filesystem (GCFS). + If unspecified, GCFS will not be enabled on the node pool. When enabling this feature you must specify image_type = "COS_CONTAINERD" and node_version from GKE versions 1.19 or later to use it. + For GKE versions 1.19, 1.20, and 1.21, the recommended minimum node_version would be 1.19.15-gke.1300, 1.20.11-gke.1300, and 1.21.5-gke.1300 respectively. + A machine_type that has more than 16 GiB of memory is also recommended. + GCFS must be enabled in order to use image streaming. + Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[Gvnic] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[KubeletConfig] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[LinuxNodeConfigModel3] = None + """ + Parameters that can be configured on Linux nodes. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + wide default value. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCP labels (key/value pairs) to be applied to each node. Refer here + for how these labels are applied to clusters, node pools and nodes. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[SoleTenantConfig] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class Autoscaling(BaseModel): + locationPolicy: Optional[str] = None + maxNodeCount: Optional[float] = None + minNodeCount: Optional[float] = None + totalMaxNodeCount: Optional[float] = None + totalMinNodeCount: Optional[float] = None + + +class ManagementModel1(BaseModel): + autoRepair: Optional[bool] = None + """ + Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. + """ + autoUpgrade: Optional[bool] = None + """ + Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes. + """ + + +class AdditionalNodeNetworkConfig(BaseModel): + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class AdditionalPodNetworkConfig(BaseModel): + maxPodsPerNode: Optional[float] = None + secondaryPodRange: Optional[str] = None + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class NetworkConfig(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + createPodRange: Optional[bool] = None + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + podIpv4CidrBlock: Optional[str] = None + podRange: Optional[str] = None + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + + +class NodeConfigModel1(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + """ + Specifies options for controlling + advanced machine features. Structure is documented below. + """ + bootDiskKmsKey: Optional[str] = None + """ + The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption + """ + confidentialNodes: Optional[ConfidentialNodesModel4] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below. + """ + containerdConfig: Optional[ContainerdConfig] = None + """ + Parameters to customize containerd runtime. Structure is documented below. + """ + diskSizeGb: Optional[float] = None + """ + Size of the disk attached to each node, specified + in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. + """ + diskType: Optional[str] = None + """ + Type of the disk attached to each node + (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-balanced' + """ + effectiveTaints: Optional[List[EffectiveTaint]] = None + """ + List of kubernetes taints applied to each node. Structure is documented above. + """ + enableConfidentialStorage: Optional[bool] = None + """ + Enabling Confidential Storage will create boot disk with confidential mode. It is disabled by default. + """ + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + """ + Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below. + """ + fastSocket: Optional[FastSocket] = None + """ + Parameters for the NCCL Fast Socket feature. If unspecified, NCCL Fast Socket will not be enabled on the node pool. + Node Pool must enable gvnic. + GKE version 1.25.2-gke.1700 or later. + Structure is documented below. + """ + flexStart: Optional[bool] = None + """ + Enables Flex Start provisioning model for the node pool. + """ + gcfsConfig: Optional[GcfsConfig] = None + """ + The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable image streaming across all the node pools within the cluster. Structure is documented below. + """ + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + """ + List of the type and count of accelerator cards attached to the instance. + Structure documented below. + Note: As of 6.0.0, argument syntax + is no longer supported for this field in favor of block syntax. + To dynamically set a list of guest accelerators, use dynamic blocks. + To set an empty list, use a single guest_accelerator block with count = 0. + """ + gvnic: Optional[Gvnic] = None + """ + Google Virtual NIC (gVNIC) is a virtual network interface. + Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. + gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. + GKE node version 1.15.11-gke.15 or later + Structure is documented below. + """ + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + imageType: Optional[str] = None + """ + The image type to use for this node. Note that changing the image type + will delete and recreate all nodes in the node pool. + """ + kubeletConfig: Optional[KubeletConfig] = None + """ + Kubelet configuration, currently supported attributes can be found here. + Structure is documented below. + """ + labels: Optional[Dict[str, str]] = None + """ + The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are + reserved by Kubernetes Core components and cannot be specified. + """ + linuxNodeConfig: Optional[LinuxNodeConfigModel3] = None + """ + Linux system configuration for the cluster's automatically provisioned node pools. Only cgroup_mode field is supported in node_pool_auto_config. Structure is documented below. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + """ + Parameters for the local NVMe SSDs. Structure is documented below. + """ + localSsdCount: Optional[float] = None + """ + The amount of local SSD disks that will be + attached to each cluster node. Defaults to 0. + """ + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + """ + The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information. + """ + machineType: Optional[str] = None + """ + The name of a Google Compute Engine machine type. + Defaults to e2-medium. To create a custom machine type, value should be set as specified + here. + """ + maxRunDuration: Optional[str] = None + """ + The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s". + """ + metadata: Optional[Dict[str, str]] = None + """ + The metadata key/value pairs assigned to instances in + the cluster. From GKE 1. To avoid this, set the + value in your config. + """ + minCpuPlatform: Optional[str] = None + """ + Minimum CPU platform to be used by this instance. + The instance may be scheduled on the specified or newer CPU platform. Applicable + values are the friendly names of CPU platforms, such as Intel Haswell. See the + official documentation + for more information. + """ + nodeGroup: Optional[str] = None + """ + Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes. + """ + oauthScopes: Optional[List[str]] = None + """ + The set of Google API scopes to be made available + on all of the node VMs under the "default" service account. + Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. + """ + preemptible: Optional[bool] = None + """ + A boolean that represents whether or not the underlying node VMs + are preemptible. See the official documentation + for more information. Defaults to false. + """ + reservationAffinity: Optional[ReservationAffinity] = None + """ + The configuration of the desired reservation which instances could take capacity from. Structure is documented below. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceManagerTags: Optional[Dict[str, str]] = None + """ + A map of resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Tags must be according to specifications found here. A maximum of 5 tag key-value pairs can be specified. Existing tags will be replaced with new values. Tags must be in one of the following formats ([KEY]=[VALUE]) 1. tagKeys/{tag_key_id}=tagValues/{tag_value_id} 2. {org_id}/{tag_key_name}={tag_value_name} 3. {project_id}/{tag_key_name}={tag_value_name}. + """ + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + """ + Parameters for secondary boot disks to preload container images and data on new nodes. Structure is documented below. gcfs_config must be enabled=true for this feature to work. min_master_version must also be set to use GKE 1.28.3-gke.106700 or later versions. + """ + serviceAccount: Optional[str] = None + """ + The service account to be used by the Node VMs. + If not specified, the "default" service account is used. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + """ + Shielded Instance options. Structure is documented below. + """ + soleTenantConfig: Optional[SoleTenantConfig] = None + """ + Allows specifying multiple node affinities useful for running workloads on sole tenant nodes. node_affinity structure is documented below. + """ + spot: Optional[bool] = None + """ + A boolean that represents whether the underlying node VMs are spot. + See the official documentation + for more information. Defaults to false. + """ + storagePools: Optional[List[str]] = None + """ + The list of Storage Pools where boot disks are provisioned. + """ + tags: Optional[List[str]] = None + """ + The list of instance tags applied to all nodes. Tags are used to identify + valid sources or targets for network firewalls. + """ + taint: Optional[List[TaintItem]] = None + """ + A list of + Kubernetes taints + to apply to nodes. Structure is documented below. + """ + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Windows node configuration, currently supporting OSVersion attribute. The value must be one of [OS_VERSION_UNSPECIFIED, OS_VERSION_LTSC2019, OS_VERSION_LTSC2022]. For example: + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + """ + Metadata configuration to expose to workloads on the node pool. + Structure is documented below. + """ + + +class PlacementPolicy(BaseModel): + policyName: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + tpuTopology: Optional[str] = None + type: Optional[str] = None + """ + The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. + """ + + +class QueuedProvisioning(BaseModel): + enabled: Optional[bool] = None + """ + Enables vertical pod autoscaling + """ + + +class NodePoolItem(BaseModel): + autoscaling: Optional[Autoscaling] = None + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + instanceGroupUrls: Optional[List[str]] = None + managedInstanceGroupUrls: Optional[List[str]] = None + management: Optional[ManagementModel1] = None + """ + NodeManagement configuration for this NodePool. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + name: Optional[str] = None + """ + The name of the cluster, unique within the project and + location. + """ + namePrefix: Optional[str] = None + networkConfig: Optional[NetworkConfig] = None + nodeConfig: Optional[NodeConfigModel1] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeCount: Optional[float] = None + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + placementPolicy: Optional[PlacementPolicy] = None + queuedProvisioning: Optional[QueuedProvisioning] = None + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specifies the upgrade settings for NAP created node pools. Structure is documented below. + """ + version: Optional[str] = None + + +class LinuxNodeConfigModel4(BaseModel): + cgroupMode: Optional[str] = None + """ + Possible cgroup modes that can be used. + Accepted values are: + """ + + +class PrivateClusterConfigModel(BaseModel): + enablePrivateEndpoint: Optional[bool] = None + """ + When true, the cluster's private + endpoint is used as the cluster endpoint and access through the public endpoint + is disabled. When false, either endpoint can be used. This field only applies + to private clusters, when enable_private_nodes is true. + """ + enablePrivateNodes: Optional[bool] = None + """ + Enables the private cluster feature, + creating a private endpoint on the cluster. In a private cluster, nodes only + have RFC 1918 private addresses and communicate with the master's private + endpoint via private networking. + """ + masterGlobalAccessConfig: Optional[MasterGlobalAccessConfig] = None + """ + Controls cluster master global + access settings. Structure is documented below. + """ + masterIpv4CidrBlock: Optional[str] = None + """ + The IP range in CIDR notation to use for + the hosted master network. This range will be used for assigning private IP + addresses to the cluster master(s) and the ILB VIP. This range must not overlap + with any other ranges in use within the cluster's network, and it must be a /28 + subnet. See Private Cluster Limitations + for more details. This field only applies to private clusters, when + enable_private_nodes is true. + """ + peeringName: Optional[str] = None + """ + The name of the peering between this cluster and the Google owned VPC. + """ + privateEndpoint: Optional[str] = None + """ + The internal IP address of this cluster's master endpoint. + """ + privateEndpointSubnetwork: Optional[str] = None + """ + Subnetwork in cluster's network where master's endpoint will be provisioned. + """ + publicEndpoint: Optional[str] = None + """ + The external IP address of this cluster's master endpoint. + """ + + +class AtProvider(BaseModel): + addonsConfig: Optional[AddonsConfig] = None + """ + The configuration for addons supported by GKE. + Structure is documented below. + """ + allowNetAdmin: Optional[bool] = None + """ + Enable NET_ADMIN for the cluster. Defaults to + false. This field should only be enabled for Autopilot clusters (enable_autopilot + set to true). + """ + anonymousAuthenticationConfig: Optional[AnonymousAuthenticationConfig] = None + """ + Configuration for anonymous authentication restrictions. Structure is documented below. + """ + authenticatorGroupsConfig: Optional[AuthenticatorGroupsConfig] = None + """ + Configuration for the + Google Groups for GKE feature. + Structure is documented below. + """ + binaryAuthorization: Optional[BinaryAuthorization] = None + """ + Configuration options for the Binary + Authorization feature. Structure is documented below. + """ + clusterAutoscaling: Optional[ClusterAutoscaling] = None + """ + Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to + automatically adjust the size of the cluster and create/delete node pools based + on the current needs of the cluster's workload. See the + guide to using Node Auto-Provisioning + for more details. Structure is documented below. + """ + clusterIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes pods + in this cluster in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one + automatically chosen or specify a /14 block in 10.0.0.0/8. This field will + default a new cluster to routes-based, where ip_allocation_policy is not defined. + """ + confidentialNodes: Optional[ConfidentialNodesModel3] = None + """ + Configuration for Confidential Nodes feature. Structure is documented below documented below. + """ + controlPlaneEndpointsConfig: Optional[ControlPlaneEndpointsConfig] = None + """ + Configuration for all of the cluster's control plane endpoints. + Structure is documented below. + """ + costManagementConfig: Optional[CostManagementConfig] = None + """ + Configuration for the + Cost Allocation feature. + Structure is documented below. + """ + databaseEncryption: Optional[DatabaseEncryption] = None + """ + Structure is documented below. + """ + datapathProvider: Optional[str] = None + """ + The desired datapath provider for this cluster. This is set to LEGACY_DATAPATH by default, which uses the IPTables-based kube-proxy implementation. Set to ADVANCED_DATAPATH to enable Dataplane v2. + """ + defaultMaxPodsPerNode: Optional[float] = None + """ + The default maximum number of pods + per node in this cluster. This doesn't work on "routes-based" clusters, clusters + that don't have IP Aliasing enabled. See the official documentation + for more information. + """ + defaultSnatStatus: Optional[DefaultSnatStatus] = None + """ + GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below + """ + deletionProtection: Optional[bool] = None + description: Optional[str] = None + """ + Description of the cluster. + """ + disableL4LbFirewallReconciliation: Optional[bool] = None + """ + Disable L4 load balancer VPC firewalls to enable firewall policies. + """ + dnsConfig: Optional[DnsConfig] = None + """ + Configuration for Using Cloud DNS for GKE. Structure is documented below. + """ + effectiveLabels: Optional[Dict[str, str]] = None + enableAutopilot: Optional[bool] = None + """ + Enable Autopilot for this cluster. Defaults to false. + Note that when this option is enabled, certain features of Standard GKE are not available. + See the official documentation + for available features. + """ + enableCiliumClusterwideNetworkPolicy: Optional[bool] = None + """ + Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false. + """ + enableFqdnNetworkPolicy: Optional[bool] = None + """ + Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 anetd DaemonSet after enabling it. See the Enable FQDN Network Policy in an existing cluster for more information. + """ + enableIntranodeVisibility: Optional[bool] = None + """ + Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. + """ + enableK8SBetaApis: Optional[EnableK8SBetaApis] = None + """ + Configuration for Kubernetes Beta APIs. + Structure is documented below. + """ + enableKubernetesAlpha: Optional[bool] = None + """ + Whether to enable Kubernetes Alpha features for + this cluster. Note that when this option is enabled, the cluster cannot be upgraded + and will be automatically deleted after 30 days. + """ + enableL4IlbSubsetting: Optional[bool] = None + """ + Whether L4ILB Subsetting is enabled for this cluster. + """ + enableLegacyAbac: Optional[bool] = None + """ + Whether the ABAC authorizer is enabled for this cluster. + When enabled, identities in the system, including service accounts, nodes, and controllers, + will have statically granted permissions beyond those provided by the RBAC configuration or IAM. + Defaults to false + """ + enableMultiNetworking: Optional[bool] = None + """ + Whether multi-networking is enabled for this cluster. + """ + enableShieldedNodes: Optional[bool] = None + """ + Enable Shielded Nodes features on all nodes in this cluster. Defaults to true. + """ + enableTpu: Optional[bool] = None + """ + Whether to enable Cloud TPU resources in this cluster. + See the official documentation. + """ + endpoint: Optional[str] = None + """ + The IP address of this cluster's Kubernetes master. + """ + enterpriseConfig: Optional[EnterpriseConfigModel] = None + """ + Configuration for [Enterprise edition].(https://cloud.google.com/kubernetes-engine/enterprise/docs/concepts/gke-editions). Structure is documented below. + """ + fleet: Optional[FleetModel] = None + """ + Fleet configuration for the cluster. Structure is documented below. + """ + gatewayApiConfig: Optional[GatewayApiConfig] = None + """ + Configuration for GKE Gateway API controller. Structure is documented below. + """ + gkeAutoUpgradeConfig: Optional[GkeAutoUpgradeConfig] = None + """ + Configuration options for the auto-upgrade patch type feature, which provide more control over the speed of automatic upgrades of your GKE clusters. + Structure is documented below. + """ + id: Optional[str] = None + """ + an identifier for the resource with format projects/{{project}}/locations/{{zone}}/clusters/{{name}} + """ + identityServiceConfig: Optional[IdentityServiceConfig] = None + """ + . Structure is documented below. + """ + inTransitEncryptionConfig: Optional[str] = None + """ + Defines the config of in-transit encryption. Valid values are IN_TRANSIT_ENCRYPTION_DISABLED and IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT. + """ + initialNodeCount: Optional[float] = None + """ + The number of nodes to create in this + cluster's default node pool. In regional or multi-zonal clusters, this is the + number of nodes per zone. Must be set if node_pool is not set. If you're using + google_container_node_pool objects with no default node pool, you'll need to + set this to a value of at least 1, alongside setting + remove_default_node_pool to true. + """ + ipAllocationPolicy: Optional[IpAllocationPolicy] = None + """ + Configuration of cluster IP allocation for + VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend. + Structure is documented below. + """ + labelFingerprint: Optional[str] = None + """ + The fingerprint of the set of labels for this cluster. + """ + location: Optional[str] = None + """ + The location (region or zone) in which the cluster + master will be created, as well as the default node location. If you specify a + zone (such as us-central1-a), the cluster will be a zonal cluster with a + single cluster master. If you specify a region (such as us-west1), the + cluster will be a regional cluster with multiple masters spread across zones in + the region, and with default node locations in those zones as well + """ + loggingConfig: Optional[LoggingConfig] = None + """ + Logging configuration for the cluster. + Structure is documented below. + """ + loggingService: Optional[str] = None + """ + The logging service that the cluster should + write logs to. Available options include logging.googleapis.com(Legacy Stackdriver), + logging.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to logging.googleapis.com/kubernetes + """ + maintenancePolicy: Optional[MaintenancePolicy] = None + """ + The maintenance policy to use for the cluster. Structure is + documented below. + """ + masterAuth: Optional[MasterAuthModel] = None + """ + The authentication information for accessing the + Kubernetes master. Some values in this block are only returned by the API if + your service account has permission to get credentials for your GKE cluster. If + you see an unexpected diff unsetting your client cert, ensure you have the + container.clusters.getCredentials permission. + Structure is documented below. + """ + masterAuthorizedNetworksConfig: Optional[MasterAuthorizedNetworksConfig] = None + """ + The desired + configuration options for master authorized networks. Omit the + nested cidr_blocks attribute to disallow external access (except + the cluster node IPs, which GKE automatically whitelists). + Structure is documented below. + """ + masterVersion: Optional[str] = None + """ + The current version of the master in the cluster. This may + be different than the min_master_version set in the config if the master + has been updated by GKE. + """ + meshCertificates: Optional[MeshCertificates] = None + """ + Structure is documented below. + """ + minMasterVersion: Optional[str] = None + """ + The minimum version of the master. GKE + will auto-update the master to new versions, so this does not guarantee the + current master version--use the read-only master_version field to obtain that. + If unset, the cluster's version will be set by GKE to the version of the most recent + official release (which is not necessarily the latest version). If you intend to specify versions manually, + the docs + describe the various acceptable formats for this field. + """ + monitoringConfig: Optional[MonitoringConfig] = None + """ + Monitoring configuration for the cluster. + Structure is documented below. + """ + monitoringService: Optional[str] = None + """ + The monitoring service that the cluster + should write metrics to. + Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. + VM metrics will be collected by Google Compute Engine regardless of this setting + Available options include + monitoring.googleapis.com(Legacy Stackdriver), monitoring.googleapis.com/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. + Defaults to monitoring.googleapis.com/kubernetes + """ + network: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + network to which the cluster is connected. For Shared VPC, set this to the self link of the + shared network. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + networkPolicy: Optional[NetworkPolicy] = None + """ + Configuration options for the + NetworkPolicy + feature. Structure is documented below. + """ + networkingMode: Optional[str] = None + """ + Determines whether alias IPs or routes will be used for pod IPs in the cluster. + Options are VPC_NATIVE or ROUTES. VPC_NATIVE enables IP aliasing. Newly created clusters will default to VPC_NATIVE. + """ + nodeConfig: Optional[NodeConfigModel] = None + """ + Parameters used in creating the default node pool. Structure is documented below. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the cluster's nodes + are located. Nodes must be in the region of their regional cluster or in the + same region as their cluster's zone for zonal clusters. If this is specified for + a zonal cluster, omit the cluster's zone. + """ + nodePool: Optional[List[NodePoolItem]] = None + """ + List of node pools associated with this cluster. + See google_container_node_pool for schema. + Warning: node pools defined inside a cluster can't be changed (or added/removed) after + cluster creation without deleting and recreating the entire cluster. Unless you absolutely need the ability + to say "these are the only node pools associated with this cluster", use the + google_container_node_pool resource instead of this property. + """ + nodePoolAutoConfig: Optional[NodePoolAutoConfig] = None + """ + Node pool configs that apply to auto-provisioned node pools in + autopilot clusters and + node auto-provisioning-enabled clusters. Structure is documented below. + """ + nodePoolDefaults: Optional[NodePoolDefaults] = None + """ + Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below. + """ + nodeVersion: Optional[str] = None + """ + The Kubernetes version on the nodes. Must either be unset + or set to the same value as min_master_version on create. Defaults to the default + version set by GKE which is not necessarily the latest version. This only affects + nodes in the default node pool. + To update nodes in other node pools, use the version attribute on the node pool. + """ + notificationConfig: Optional[NotificationConfig] = None + """ + Configuration for the cluster upgrade notifications feature. Structure is documented below. + """ + operation: Optional[str] = None + podAutoscaling: Optional[PodAutoscaling] = None + """ + Configuration for the + Structure is documented below. + """ + privateClusterConfig: Optional[PrivateClusterConfigModel] = None + """ + Configuration for private clusters, + clusters with private nodes. Structure is documented below. + """ + privateIpv6GoogleAccess: Optional[str] = None + """ + The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4). + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it + is not provided, the provider project is used. + """ + rbacBindingConfig: Optional[RbacBindingConfig] = None + """ + RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. Structure is documented below. + """ + releaseChannel: Optional[ReleaseChannel] = None + """ + Configuration options for the Release channel + feature, which provide more control over automatic upgrades of your GKE clusters. + When updating this field, GKE imposes specific version requirements. See + Selecting a new release channel + for more details; the google_container_engine_versions datasource can provide + the default version for a channel. Instead, use the "UNSPECIFIED" + channel. Structure is documented below. + """ + removeDefaultNodePool: Optional[bool] = None + """ + If true, deletes the default node + pool upon cluster creation. If you're using google_container_node_pool + resources with no default node pool, this should be set to true, alongside + setting initial_node_count to at least 1. + """ + resourceLabels: Optional[Dict[str, str]] = None + """ + The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + """ + resourceUsageExportConfig: Optional[ResourceUsageExportConfig] = None + """ + Configuration for the + ResourceUsageExportConfig feature. + Structure is documented below. + """ + secretManagerConfig: Optional[SecretManagerConfig] = None + """ + Configuration for the + SecretManagerConfig feature. + Structure is documented below. + """ + securityPostureConfig: Optional[SecurityPostureConfig] = None + """ + Enable/Disable Security Posture API features for the cluster. Structure is documented below. + """ + selfLink: Optional[str] = None + """ + The server-defined URL for the resource. + """ + serviceExternalIpsConfig: Optional[ServiceExternalIpsConfig] = None + """ + Structure is documented below. + """ + servicesIpv4Cidr: Optional[str] = None + """ + The IP address range of the Kubernetes services in this + cluster, in CIDR + notation (e.g. 1.2.3.4/29). Service addresses are typically put in the last + /16 from the container CIDR. + """ + subnetwork: Optional[str] = None + """ + The name or self_link of the Google Compute Engine + subnetwork in which the cluster's instances are launched. + """ + terraformLabels: Optional[Dict[str, str]] = None + """ + The combination of labels configured directly on the resource and default labels configured on the provider. + """ + tpuIpv4CidrBlock: Optional[str] = None + """ + The IP address range of the Cloud TPUs in this cluster, in + CIDR + notation (e.g. 1.2.3.4/29). + """ + userManagedKeysConfig: Optional[UserManagedKeysConfig] = None + """ + The custom keys configuration of the cluster Structure is documented below. + """ + verticalPodAutoscaling: Optional[VerticalPodAutoscaling] = None + """ + Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. + Structure is documented below. + """ + workloadIdentityConfig: Optional[WorkloadIdentityConfig] = None + """ + Workload Identity allows Kubernetes service accounts to act as a user-managed + Google IAM Service Account. + Structure is documented below. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Cluster(BaseModel): + apiVersion: Optional[Literal['container.gcp.m.upbound.io/v1beta1']] = ( + 'container.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Cluster']] = 'Cluster' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + ClusterSpec defines the desired state of Cluster + """ + status: Optional[Status] = None + """ + ClusterStatus defines the observed state of Cluster. + """ + + +class ClusterList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Cluster] + """ + List of clusters. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/container/nodepool/__init__.py b/schemas/python/models/io/upbound/m/gcp/container/nodepool/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/container/nodepool/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/container/nodepool/v1beta1.py new file mode 100644 index 000000000..c7948d586 --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/container/nodepool/v1beta1.py @@ -0,0 +1,1084 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_m_upbound_io_v1beta1_nodepool.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class Autoscaling(BaseModel): + locationPolicy: Optional[str] = None + """ + Location policy specifies the algorithm used when + scaling-up the node pool. Location policy is supported only in 1.24.1+ clusters. + """ + maxNodeCount: Optional[float] = None + """ + Maximum number of nodes per zone in the NodePool. + Must be >= min_node_count. Cannot be used with total limits. + """ + minNodeCount: Optional[float] = None + """ + Minimum number of nodes per zone in the NodePool. + Must be >=0 and <= max_node_count. Cannot be used with total limits. + """ + totalMaxNodeCount: Optional[float] = None + """ + Total maximum number of nodes in the NodePool. + Must be >= total_min_node_count. Cannot be used with per zone limits. + Total size limits are supported only in 1.24.1+ clusters. + """ + totalMinNodeCount: Optional[float] = None + """ + Total minimum number of nodes in the NodePool. + Must be >=0 and <= total_max_node_count. Cannot be used with per zone limits. + Total size limits are supported only in 1.24.1+ clusters. + """ + + +class Policy(BaseModel): + resolution: Optional[Literal['Required', 'Optional']] = 'Required' + """ + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + """ + resolve: Optional[Literal['Always', 'IfNotPresent']] = None + """ + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + """ + + +class ClusterRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ClusterSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class Management(BaseModel): + autoRepair: Optional[bool] = None + """ + Whether the nodes will be automatically repaired. Enabled by default. + """ + autoUpgrade: Optional[bool] = None + """ + Whether the nodes will be automatically upgraded. Enabled by default. + """ + + +class AdditionalNodeNetworkConfig(BaseModel): + network: Optional[str] = None + """ + Name of the VPC where the additional interface belongs. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class AdditionalPodNetworkConfig(BaseModel): + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + secondaryPodRange: Optional[str] = None + """ + The name of the secondary range on the subnet which provides IP address for this pod range. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class NetworkPerformanceConfig(BaseModel): + totalEgressBandwidthTier: Optional[str] = None + """ + Specifies the total network bandwidth tier for the NodePool. Valid values include: "TIER_1" and "TIER_UNSPECIFIED". + """ + + +class PodCidrOverprovisionConfig(BaseModel): + disabled: Optional[bool] = None + """ + Whether pod cidr overprovision is disabled. + """ + + +class NetworkConfig(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + """ + We specify the additional node networks for this node pool using this list. Each node network corresponds to an additional interface. + Structure is documented below + """ + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + """ + We specify the additional pod networks for this node pool using this list. Each pod network corresponds to an additional alias IP range for the node. + Structure is documented below + """ + createPodRange: Optional[bool] = None + """ + Whether to create a new range for pod IPs in this node pool. Defaults are provided for pod_range and pod_ipv4_cidr_block if they are not specified. + """ + enablePrivateNodes: Optional[bool] = None + """ + Whether nodes have internal IP addresses only. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + """ + Configuration for node-pool level pod cidr overprovision. If not set, the cluster level setting will be inherited. Structure is documented below. + """ + podIpv4CidrBlock: Optional[str] = None + """ + The IP address range for pod IPs in this node pool. Only applicable if createPodRange is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) to pick a specific range to use. + """ + podRange: Optional[str] = None + """ + The ID of the secondary range for pod IPs. If create_pod_range is true, this ID is used for the new range. If create_pod_range is false, uses an existing secondary range with this ID. + """ + + +class AdvancedMachineFeatures(BaseModel): + enableNestedVirtualization: Optional[bool] = None + performanceMonitoringUnit: Optional[str] = None + threadsPerCore: Optional[float] = None + + +class ConfidentialNodes(BaseModel): + confidentialInstanceType: Optional[str] = None + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GcpSecretManagerCertificateConfig(BaseModel): + secretUri: Optional[str] = None + + +class CertificateAuthorityDomainConfigItem(BaseModel): + fqdns: Optional[List[str]] = None + gcpSecretManagerCertificateConfig: Optional[GcpSecretManagerCertificateConfig] = ( + None + ) + + +class PrivateRegistryAccessConfig(BaseModel): + certificateAuthorityDomainConfig: Optional[ + List[CertificateAuthorityDomainConfigItem] + ] = None + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class ContainerdConfig(BaseModel): + privateRegistryAccessConfig: Optional[PrivateRegistryAccessConfig] = None + + +class EphemeralStorageLocalSsdConfig(BaseModel): + dataCacheCount: Optional[float] = None + localSsdCount: Optional[float] = None + + +class FastSocket(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GcfsConfig(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class GpuDriverInstallationConfig(BaseModel): + gpuDriverVersion: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class GpuSharingConfig(BaseModel): + gpuSharingStrategy: Optional[str] = None + maxSharedClientsPerGpu: Optional[float] = None + + +class GuestAcceleratorItem(BaseModel): + count: Optional[float] = None + gpuDriverInstallationConfig: Optional[GpuDriverInstallationConfig] = None + gpuPartitionSize: Optional[str] = None + gpuSharingConfig: Optional[GpuSharingConfig] = None + type: Optional[str] = None + """ + The type of the policy. Supports a single value: COMPACT. + Specifying COMPACT placement policy type places node pool's nodes in a closer + physical proximity in order to reduce network latency between nodes. + """ + + +class Gvnic(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class HostMaintenancePolicy(BaseModel): + maintenanceInterval: Optional[str] = None + + +class KubeletConfig(BaseModel): + allowedUnsafeSysctls: Optional[List[str]] = None + containerLogMaxFiles: Optional[float] = None + containerLogMaxSize: Optional[str] = None + cpuCfsQuota: Optional[bool] = None + cpuCfsQuotaPeriod: Optional[str] = None + cpuManagerPolicy: Optional[str] = None + imageGcHighThresholdPercent: Optional[float] = None + imageGcLowThresholdPercent: Optional[float] = None + imageMaximumGcAge: Optional[str] = None + imageMinimumGcAge: Optional[str] = None + insecureKubeletReadonlyPortEnabled: Optional[str] = None + podPidsLimit: Optional[float] = None + + +class HugepagesConfig(BaseModel): + hugepageSize1G: Optional[float] = None + hugepageSize2M: Optional[float] = None + + +class LinuxNodeConfig(BaseModel): + cgroupMode: Optional[str] = None + hugepagesConfig: Optional[HugepagesConfig] = None + sysctls: Optional[Dict[str, str]] = None + + +class LocalNvmeSsdBlockConfig(BaseModel): + localSsdCount: Optional[float] = None + + +class ReservationAffinity(BaseModel): + consumeReservationType: Optional[str] = None + """ + The type of reservation consumption + Accepted values are: + """ + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + values: Optional[List[str]] = None + """ + name" + """ + + +class SecondaryBootDisk(BaseModel): + diskImage: Optional[str] = None + mode: Optional[str] = None + + +class ServiceAccountRef(BaseModel): + name: str + """ + Name of the referenced object. + """ + namespace: Optional[str] = None + """ + Namespace of the referenced object + """ + policy: Optional[Policy] = None + """ + Policies for referencing. + """ + + +class ServiceAccountSelector(BaseModel): + matchControllerRef: Optional[bool] = None + """ + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + """ + matchLabels: Optional[Dict[str, str]] = None + """ + MatchLabels ensures an object with matching labels is selected. + """ + namespace: Optional[str] = None + """ + Namespace for the selector + """ + policy: Optional[Policy] = None + """ + Policies for selection. + """ + + +class ShieldedInstanceConfig(BaseModel): + enableIntegrityMonitoring: Optional[bool] = None + enableSecureBoot: Optional[bool] = None + + +class NodeAffinityItem(BaseModel): + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + operator: Optional[str] = None + values: Optional[List[str]] = None + """ + name" + """ + + +class SoleTenantConfig(BaseModel): + nodeAffinity: Optional[List[NodeAffinityItem]] = None + + +class TaintItem(BaseModel): + effect: Optional[str] = None + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + value: Optional[str] = None + + +class WindowsNodeConfig(BaseModel): + osversion: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class WorkloadMetadataConfig(BaseModel): + mode: Optional[str] = None + + +class NodeConfig(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + bootDiskKmsKey: Optional[str] = None + confidentialNodes: Optional[ConfidentialNodes] = None + containerdConfig: Optional[ContainerdConfig] = None + diskSizeGb: Optional[float] = None + diskType: Optional[str] = None + enableConfidentialStorage: Optional[bool] = None + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + fastSocket: Optional[FastSocket] = None + flexStart: Optional[bool] = None + gcfsConfig: Optional[GcfsConfig] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + gvnic: Optional[Gvnic] = None + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + imageType: Optional[str] = None + kubeletConfig: Optional[KubeletConfig] = None + labels: Optional[Dict[str, str]] = None + linuxNodeConfig: Optional[LinuxNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + localSsdCount: Optional[float] = None + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + machineType: Optional[str] = None + maxRunDuration: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + minCpuPlatform: Optional[str] = None + nodeGroup: Optional[str] = None + oauthScopes: Optional[List[str]] = None + preemptible: Optional[bool] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourceLabels: Optional[Dict[str, str]] = None + resourceManagerTags: Optional[Dict[str, str]] = None + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + serviceAccount: Optional[str] = None + serviceAccountRef: Optional[ServiceAccountRef] = None + """ + Reference to a ServiceAccount in cloudplatform to populate serviceAccount. + """ + serviceAccountSelector: Optional[ServiceAccountSelector] = None + """ + Selector for a ServiceAccount in cloudplatform to populate serviceAccount. + """ + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + soleTenantConfig: Optional[SoleTenantConfig] = None + spot: Optional[bool] = None + storagePools: Optional[List[str]] = None + tags: Optional[List[str]] = None + taint: Optional[List[TaintItem]] = None + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + + +class PlacementPolicy(BaseModel): + policyName: Optional[str] = None + """ + If set, refers to the name of a custom resource policy supplied by the user. + The resource policy must be in the same project and region as the node pool. + If not found, InvalidArgument error is returned. + """ + tpuTopology: Optional[str] = None + """ + The TPU topology like "2x4" or "2x2x2". + """ + type: Optional[str] = None + """ + The type of the policy. Supports a single value: COMPACT. + Specifying COMPACT placement policy type places node pool's nodes in a closer + physical proximity in order to reduce network latency between nodes. + """ + + +class QueuedProvisioning(BaseModel): + enabled: Optional[bool] = None + """ + Makes nodes obtainable through the ProvisioningRequest API exclusively. + """ + + +class StandardRolloutPolicy(BaseModel): + batchNodeCount: Optional[float] = None + """ + Number of blue nodes to drain in a batch. + """ + batchPercentage: Optional[float] = None + """ + Percentage of the blue pool nodes to drain in a batch. + """ + batchSoakDuration: Optional[str] = None + """ + (Optionial) Soak time after each batch gets drained. + """ + + +class BlueGreenSettings(BaseModel): + nodePoolSoakDuration: Optional[str] = None + """ + Time needed after draining the entire blue pool. + After this period, the blue pool will be cleaned up. + """ + standardRolloutPolicy: Optional[StandardRolloutPolicy] = None + """ + Specifies the standard policy settings for blue-green upgrades. + """ + + +class UpgradeSettings(BaseModel): + blueGreenSettings: Optional[BlueGreenSettings] = None + """ + The settings to adjust blue green upgrades. + Structure is documented below + """ + maxSurge: Optional[float] = None + """ + The number of additional nodes that can be added to the node pool during + an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. + Can be set to 0 or greater. + """ + maxUnavailable: Optional[float] = None + """ + The number of nodes that can be simultaneously unavailable during + an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in + parallel. Can be set to 0 or greater. + """ + strategy: Optional[str] = None + """ + (Default SURGE) The upgrade strategy to be used for upgrading the nodes. + """ + + +class ForProvider(BaseModel): + autoscaling: Optional[Autoscaling] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + cluster: Optional[str] = None + """ + The cluster to create the node pool for. Cluster must be present in location provided for clusters. May be specified in the format projects/{{project}}/locations/{{location}}/clusters/{{cluster}} or as just the name of the cluster. + """ + clusterRef: Optional[ClusterRef] = None + """ + Reference to a Cluster in container to populate cluster. + """ + clusterSelector: Optional[ClusterSelector] = None + """ + Selector for a Cluster in container to populate cluster. + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + location: Optional[str] = None + """ + The location (region or zone) of the cluster. + """ + management: Optional[Management] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[NetworkConfig] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + placementPolicy: Optional[PlacementPolicy] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[QueuedProvisioning] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class InitProvider(BaseModel): + autoscaling: Optional[Autoscaling] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + management: Optional[Management] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[NetworkConfig] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[NodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + placementPolicy: Optional[PlacementPolicy] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[QueuedProvisioning] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class NetworkConfigModel(BaseModel): + additionalNodeNetworkConfigs: Optional[List[AdditionalNodeNetworkConfig]] = None + """ + We specify the additional node networks for this node pool using this list. Each node network corresponds to an additional interface. + Structure is documented below + """ + additionalPodNetworkConfigs: Optional[List[AdditionalPodNetworkConfig]] = None + """ + We specify the additional pod networks for this node pool using this list. Each pod network corresponds to an additional alias IP range for the node. + Structure is documented below + """ + createPodRange: Optional[bool] = None + """ + Whether to create a new range for pod IPs in this node pool. Defaults are provided for pod_range and pod_ipv4_cidr_block if they are not specified. + """ + enablePrivateNodes: Optional[bool] = None + """ + Whether nodes have internal IP addresses only. + """ + networkPerformanceConfig: Optional[NetworkPerformanceConfig] = None + """ + Network bandwidth tier configuration. Structure is documented below. + """ + podCidrOverprovisionConfig: Optional[PodCidrOverprovisionConfig] = None + """ + Configuration for node-pool level pod cidr overprovision. If not set, the cluster level setting will be inherited. Structure is documented below. + """ + podIpv4CidrBlock: Optional[str] = None + """ + The IP address range for pod IPs in this node pool. Only applicable if createPodRange is true. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) to pick a specific range to use. + """ + podRange: Optional[str] = None + """ + The ID of the secondary range for pod IPs. If create_pod_range is true, this ID is used for the new range. If create_pod_range is false, uses an existing secondary range with this ID. + """ + subnetwork: Optional[str] = None + """ + The subnetwork path for the node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork}. If the cluster is associated with multiple subnetworks, the subnetwork for the node pool is picked based on the IP utilization during node pool creation and is immutable + """ + + +class EffectiveTaint(BaseModel): + effect: Optional[str] = None + key: Optional[str] = None + """ + name" as the key and specify the name of your reservation as its value. + """ + value: Optional[str] = None + + +class NodeConfigModel(BaseModel): + advancedMachineFeatures: Optional[AdvancedMachineFeatures] = None + bootDiskKmsKey: Optional[str] = None + confidentialNodes: Optional[ConfidentialNodes] = None + containerdConfig: Optional[ContainerdConfig] = None + diskSizeGb: Optional[float] = None + diskType: Optional[str] = None + effectiveTaints: Optional[List[EffectiveTaint]] = None + enableConfidentialStorage: Optional[bool] = None + ephemeralStorageLocalSsdConfig: Optional[EphemeralStorageLocalSsdConfig] = None + fastSocket: Optional[FastSocket] = None + flexStart: Optional[bool] = None + gcfsConfig: Optional[GcfsConfig] = None + guestAccelerator: Optional[List[GuestAcceleratorItem]] = None + gvnic: Optional[Gvnic] = None + hostMaintenancePolicy: Optional[HostMaintenancePolicy] = None + imageType: Optional[str] = None + kubeletConfig: Optional[KubeletConfig] = None + labels: Optional[Dict[str, str]] = None + linuxNodeConfig: Optional[LinuxNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + localNvmeSsdBlockConfig: Optional[LocalNvmeSsdBlockConfig] = None + localSsdCount: Optional[float] = None + localSsdEncryptionMode: Optional[str] = None + """ + Possible Local SSD encryption modes: + Accepted values are: + """ + loggingVariant: Optional[str] = None + machineType: Optional[str] = None + maxRunDuration: Optional[str] = None + metadata: Optional[Dict[str, str]] = None + minCpuPlatform: Optional[str] = None + nodeGroup: Optional[str] = None + oauthScopes: Optional[List[str]] = None + preemptible: Optional[bool] = None + reservationAffinity: Optional[ReservationAffinity] = None + resourceLabels: Optional[Dict[str, str]] = None + resourceManagerTags: Optional[Dict[str, str]] = None + secondaryBootDisks: Optional[List[SecondaryBootDisk]] = None + serviceAccount: Optional[str] = None + shieldedInstanceConfig: Optional[ShieldedInstanceConfig] = None + soleTenantConfig: Optional[SoleTenantConfig] = None + spot: Optional[bool] = None + storagePools: Optional[List[str]] = None + tags: Optional[List[str]] = None + taint: Optional[List[TaintItem]] = None + windowsNodeConfig: Optional[WindowsNodeConfig] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + workloadMetadataConfig: Optional[WorkloadMetadataConfig] = None + + +class AtProvider(BaseModel): + autoscaling: Optional[Autoscaling] = None + """ + Configuration required by cluster autoscaler to adjust + the size of the node pool to the current cluster usage. Structure is documented below. + """ + cluster: Optional[str] = None + """ + The cluster to create the node pool for. Cluster must be present in location provided for clusters. May be specified in the format projects/{{project}}/locations/{{location}}/clusters/{{cluster}} or as just the name of the cluster. + """ + id: Optional[str] = None + """ + an identifier for the resource with format {{project}}/{{location}}/{{cluster}}/{{name}} + """ + initialNodeCount: Optional[float] = None + """ + The initial number of nodes for the pool. In + regional or multi-zonal clusters, this is the number of nodes per zone. Changing + this will force recreation of the resource. If you don't + need this value, don't set it. If you do need it, you can use a lifecycle block to + ignore subsequent changes to this field. + """ + instanceGroupUrls: Optional[List[str]] = None + """ + The resource URLs of the managed instance groups associated with this node pool. + """ + location: Optional[str] = None + """ + The location (region or zone) of the cluster. + """ + managedInstanceGroupUrls: Optional[List[str]] = None + """ + List of instance group URLs which have been assigned to this node pool. + """ + management: Optional[Management] = None + """ + Node management configuration, wherein auto-repair and + auto-upgrade is configured. Structure is documented below. + """ + maxPodsPerNode: Optional[float] = None + """ + The maximum number of pods per node in this node pool. + Note that this does not work on node pools which are "route-based" - that is, node + pools belonging to clusters that do not have IP Aliasing enabled. + See the official documentation + for more information. + """ + networkConfig: Optional[NetworkConfigModel] = None + """ + The network configuration of the pool. Such as + configuration for Adding Pod IP address ranges) to the node pool. Or enabling private nodes. Structure is + documented below + """ + nodeConfig: Optional[NodeConfigModel] = None + """ + Parameters used in creating the node pool. See + google_container_cluster for schema. + """ + nodeCount: Optional[float] = None + """ + The number of nodes per instance group. This field can be used to + update the number of nodes per instance group but should not be used alongside autoscaling. + """ + nodeLocations: Optional[List[str]] = None + """ + The list of zones in which the node pool's nodes should be located. Nodes must + be in the region of their regional cluster or in the same region as their + cluster's zone for zonal clusters. If unspecified, the cluster-level + node_locations will be used. + """ + operation: Optional[str] = None + placementPolicy: Optional[PlacementPolicy] = None + """ + Specifies a custom placement policy for the + nodes. + """ + project: Optional[str] = None + """ + The ID of the project in which to create the node pool. If blank, + the provider-configured project will be used. + """ + queuedProvisioning: Optional[QueuedProvisioning] = None + """ + Specifies node pool-level settings of queued provisioning. + Structure is documented below. + """ + upgradeSettings: Optional[UpgradeSettings] = None + """ + Specify node upgrade settings to change how GKE upgrades nodes. + The maximum number of nodes upgraded simultaneously is limited to 20. Structure is documented below. + """ + version: Optional[str] = None + """ + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class NodePool(BaseModel): + apiVersion: Optional[Literal['container.gcp.m.upbound.io/v1beta1']] = ( + 'container.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['NodePool']] = 'NodePool' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + NodePoolSpec defines the desired state of NodePool + """ + status: Optional[Status] = None + """ + NodePoolStatus defines the observed state of NodePool. + """ + + +class NodePoolList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[NodePool] + """ + List of nodepools. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/io/upbound/m/gcp/container/registry/__init__.py b/schemas/python/models/io/upbound/m/gcp/container/registry/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/io/upbound/m/gcp/container/registry/v1beta1.py b/schemas/python/models/io/upbound/m/gcp/container/registry/v1beta1.py new file mode 100644 index 000000000..5fbfda71b --- /dev/null +++ b/schemas/python/models/io/upbound/m/gcp/container/registry/v1beta1.py @@ -0,0 +1,205 @@ +# generated by datamodel-codegen: +# filename: workdir/container_gcp_m_upbound_io_v1beta1_registry.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import List, Literal, Optional + +from pydantic import BaseModel, Field + +from ......k8s.apimachinery.pkg.apis.meta import v1 + + +class ForProvider(BaseModel): + location: Optional[str] = None + """ + The location of the registry. One of ASIA, EU, US or not specified. See the official documentation for more information on registry locations. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it is not provided, the provider project is used. + """ + + +class InitProvider(BaseModel): + location: Optional[str] = None + """ + The location of the registry. One of ASIA, EU, US or not specified. See the official documentation for more information on registry locations. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it is not provided, the provider project is used. + """ + + +class ProviderConfigRef(BaseModel): + kind: str + """ + Kind of the referenced object. + """ + name: str + """ + Name of the referenced object. + """ + + +class WriteConnectionSecretToRef(BaseModel): + name: str + """ + Name of the secret. + """ + + +class Spec(BaseModel): + forProvider: ForProvider + initProvider: Optional[InitProvider] = None + """ + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + """ + managementPolicies: Optional[ + List[Literal['Observe', 'Create', 'Update', 'Delete', 'LateInitialize', '*']] + ] = ['*'] + """ + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + """ + providerConfigRef: Optional[ProviderConfigRef] = Field( + default_factory=lambda: ProviderConfigRef.model_validate( + {'kind': 'ClusterProviderConfig', 'name': 'default'} + ) + ) + """ + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + """ + writeConnectionSecretToRef: Optional[WriteConnectionSecretToRef] = None + """ + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + """ + + +class AtProvider(BaseModel): + bucketSelfLink: Optional[str] = None + """ + The URI of the created resource. + """ + id: Optional[str] = None + """ + The name of the bucket that supports the Container Registry. In the form of artifacts.{project}.appspot.com or {location}.artifacts.{project}.appspot.com if location is specified. + """ + location: Optional[str] = None + """ + The location of the registry. One of ASIA, EU, US or not specified. See the official documentation for more information on registry locations. + """ + project: Optional[str] = None + """ + The ID of the project in which the resource belongs. If it is not provided, the provider project is used. + """ + + +class Condition(BaseModel): + lastTransitionTime: datetime + """ + LastTransitionTime is the last time this condition transitioned from one + status to another. + """ + message: Optional[str] = None + """ + A Message containing details about this condition's last transition from + one status to another, if any. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + """ + reason: str + """ + A Reason for this condition's last transition from one status to another. + """ + status: str + """ + Status of this condition; is it currently True, False, or Unknown? + """ + type: str + """ + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + """ + + +class Status(BaseModel): + atProvider: Optional[AtProvider] = None + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + observedGeneration: Optional[int] = None + """ + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + """ + + +class Registry(BaseModel): + apiVersion: Optional[Literal['container.gcp.m.upbound.io/v1beta1']] = ( + 'container.gcp.m.upbound.io/v1beta1' + ) + """ + 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[Literal['Registry']] = 'Registry' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + """ + RegistrySpec defines the desired state of Registry + """ + status: Optional[Status] = None + """ + RegistryStatus defines the observed state of Registry. + """ + + +class RegistryList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[Registry] + """ + List of registries. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/pyproject.toml b/schemas/python/pyproject.toml new file mode 100644 index 000000000..193120617 --- /dev/null +++ b/schemas/python/pyproject.toml @@ -0,0 +1,11 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "crossplane-models" +version = "0.0.0" +requires-python = ">=3.11,<3.14" + +[tool.hatch.build.targets.wheel] +packages = ["models"] From 35a887c2d24a0b362ad7db6cbdb957402b48b489 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Fri, 22 May 2026 12:41:50 -0700 Subject: [PATCH 4/9] Use uv and Nix to build function images outside the Crossplane CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Crossplane CLI handles simple projects end-to-end, but for a project like Modelplane — nine composition functions, unit tests, linters, type checking — it's not enough on its own. The Crossplane CLI can't run tests, check types, or lint code. A project this size needs a real build system layered on top. This commit adopts uv as the Python workspace manager and Nix as the build orchestrator, with uv2nix bridging the two. uv.lock is the single source of truth for Python dependencies. Nix reads the lockfile via uv2nix, builds per-function OCI image tarballs (including cross-arch), and runs all checks in a sandbox. The Crossplane CLI assembles the final project from pre-built tarballs via source: Tarball (crossplane/cli#24). The principle is that the Crossplane CLI should integrate with language ecosystems, not replace them. Each tool does what it's best at: uv manages Python packages, Nix orchestrates builds and CI, the Crossplane CLI packages the result. nix flake check is the one-stop CI gate: Python lint (ruff), shell lint (shellcheck, shfmt), Nix lint (statix, deadnix, nixfmt), and unit tests for all nine functions. nix run .#fix auto-fixes everything those checks verify. nix run .#generate regenerates Python schemas from XRDs and dependency CRDs. Depends on crossplane/cli#24. Signed-off-by: Nic Cope --- .github/workflows/ci.yml | 29 +- .gitignore | 2 - crossplane-project.yaml | 40 ++ flake.lock | 92 +++- flake.nix | 146 ++++-- functions/compose-gke-cluster/pyproject.toml | 11 +- .../compose-inference-class/pyproject.toml | 11 +- .../compose-inference-cluster/pyproject.toml | 11 +- .../compose-inference-gateway/pyproject.toml | 11 +- .../compose-kserve-backend/pyproject.toml | 11 +- .../compose-model-deployment/pyproject.toml | 11 +- .../compose-model-endpoint/pyproject.toml | 11 +- .../compose-model-replica/pyproject.toml | 11 +- .../compose-model-service/pyproject.toml | 11 +- nix/apps.nix | 171 +++---- nix/build.nix | 75 --- nix/checks.nix | 68 ++- nix/deps.nix | 28 ++ nix/functions.nix | 119 +++++ pyproject.toml | 21 +- schemas/.lock.json | 1 + .../io/k8s/apimachinery/pkg/apis/meta/v1.py | 2 +- uv.lock | 432 ++++++++++++++++++ 23 files changed, 1010 insertions(+), 315 deletions(-) delete mode 100644 nix/build.nix create mode 100644 nix/deps.nix create mode 100644 nix/functions.nix create mode 100644 schemas/.lock.json create mode 100644 uv.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1d9ca2d6..6d93444e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ permissions: contents: read jobs: - lint: + check: runs-on: ubuntu-24.04 steps: @@ -26,42 +26,21 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v31 - - name: Lint - run: > - nix build - .#checks.x86_64-linux.python - .#checks.x86_64-linux.shell-lint - .#checks.x86_64-linux.nix-lint - --print-build-logs - - unit-tests: - runs-on: ubuntu-24.04 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Nix - uses: cachix/install-nix-action@v31 - - - name: Build and Test - run: nix run .#test-crossplane --print-build-logs + - name: Check + run: nix flake check --print-build-logs push-package: if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: [lint, unit-tests] + needs: [check] runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 # Needed for git rev-list --count. - name: Install Nix uses: cachix/install-nix-action@v31 - # Authenticate with the registry using standard Docker credentials. # The Crossplane CLI uses Docker's credential store for OCI pushes. - name: Login to registry uses: docker/login-action@v3 diff --git a/.gitignore b/.gitignore index 4ce104b67..da3d5899a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ .venv-* _output .up -schemas/* -!schemas/python/ result .direnv __pycache__/ diff --git a/crossplane-project.yaml b/crossplane-project.yaml index ca84229e0..e9df08291 100644 --- a/crossplane-project.yaml +++ b/crossplane-project.yaml @@ -7,6 +7,46 @@ spec: source: github.com/modelplaneai/modelplane license: Apache-2.0 description: An open-source AI inference platform built on Crossplane. + architectures: [amd64, arm64] + schemas: + languages: [python] + functions: + - source: Tarball + tarball: + name: compose-gke-cluster + pathPrefix: _output/functions/compose-gke-cluster + - source: Tarball + tarball: + name: compose-inference-class + pathPrefix: _output/functions/compose-inference-class + - source: Tarball + tarball: + name: compose-inference-cluster + pathPrefix: _output/functions/compose-inference-cluster + - source: Tarball + tarball: + name: compose-inference-gateway + pathPrefix: _output/functions/compose-inference-gateway + - source: Tarball + tarball: + name: compose-kserve-backend + pathPrefix: _output/functions/compose-kserve-backend + - source: Tarball + tarball: + name: compose-model-deployment + pathPrefix: _output/functions/compose-model-deployment + - source: Tarball + tarball: + name: compose-model-endpoint + pathPrefix: _output/functions/compose-model-endpoint + - source: Tarball + tarball: + name: compose-model-replica + pathPrefix: _output/functions/compose-model-replica + - source: Tarball + tarball: + name: compose-model-service + pathPrefix: _output/functions/compose-model-service dependencies: - type: crd git: diff --git a/flake.lock b/flake.lock index 96d6b269f..4f29915d6 100644 --- a/flake.lock +++ b/flake.lock @@ -7,17 +7,17 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1779303864, - "narHash": "sha256-XMcEJMCBKiE0UWn+ChGc6qibl0YJQoLNWFzH+QAZDqY=", - "owner": "crossplane", + "lastModified": 1779477155, + "narHash": "sha256-qRbJLCPxXz5wQaGB3XKUskHOZIdClSwpKh1szn1PAHE=", + "owner": "negz", "repo": "cli", - "rev": "bc595092600d24b56c506472d2731f4fa3cad333", + "rev": "5208019668b92f9e912442583f100e78514d030a", "type": "github" }, "original": { - "owner": "crossplane", + "owner": "negz", + "ref": "diy", "repo": "cli", - "rev": "bc595092600d24b56c506472d2731f4fa3cad333", "type": "github" } }, @@ -96,11 +96,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1774244481, - "narHash": "sha256-4XfMXU0DjN83o6HWZoKG9PegCvKvIhNUnRUI19vzTcQ=", + "lastModified": 1779102034, + "narHash": "sha256-vZJZjLo513IeI8hjzHFc6TDezUd4uCE2Eq4SNO3DNNg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4590696c8693fea477850fe379a01544293ca4e2", + "rev": "687f05a9184cad4eaf905c48b63649e3a86f5433", "type": "github" }, "original": { @@ -110,10 +110,59 @@ "type": "github" } }, + "pyproject-build-systems": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "pyproject-nix": [ + "pyproject-nix" + ], + "uv2nix": [ + "uv2nix" + ] + }, + "locked": { + "lastModified": 1776659114, + "narHash": "sha256-qapCOQmR++yZSY43dzrp3wCrkOTLpod+ONtJWBk6iKU=", + "owner": "pyproject-nix", + "repo": "build-system-pkgs", + "rev": "ffaa2161dd5d63e0e94591f86b54fc239660fb2e", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "build-system-pkgs", + "type": "github" + } + }, + "pyproject-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778901413, + "narHash": "sha256-GSKXTAnFqRAMlZkJrIPcQMYf+lpMr66K3i60mB9STvc=", + "owner": "pyproject-nix", + "repo": "pyproject.nix", + "rev": "a228447c3e179d477c1b6246ef3efa8cfe3c469a", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "pyproject.nix", + "type": "github" + } + }, "root": { "inputs": { "crossplane-cli": "crossplane-cli", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "pyproject-build-systems": "pyproject-build-systems", + "pyproject-nix": "pyproject-nix", + "uv2nix": "uv2nix" } }, "systems": { @@ -130,6 +179,29 @@ "repo": "default", "type": "github" } + }, + "uv2nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "pyproject-nix": [ + "pyproject-nix" + ] + }, + "locked": { + "lastModified": 1779411315, + "narHash": "sha256-IMFlxeyClau51KplhhSRGhdGTvD/knShHdybP1UOTuk=", + "owner": "pyproject-nix", + "repo": "uv2nix", + "rev": "fdf2a76275d7a9c27deb5d2f2ab33526ac9052ff", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "uv2nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 94f2beecd..a48dc3989 100644 --- a/flake.nix +++ b/flake.nix @@ -7,9 +7,30 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; - # The Crossplane CLI, pinned to a specific commit. - # https://github.com/crossplane/cli - crossplane-cli.url = "github:crossplane/cli/bc595092600d24b56c506472d2731f4fa3cad333"; + # Pinned to the 'diy' branch until crossplane/cli#24 merges. + crossplane-cli.url = "github:negz/cli/diy"; + + # uv2nix reads a uv workspace's uv.lock and generates Nix derivations + # for each Python package, using pyproject.nix's build infrastructure. + pyproject-nix = { + url = "github:pyproject-nix/pyproject.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + uv2nix = { + url = "github:pyproject-nix/uv2nix"; + inputs = { + pyproject-nix.follows = "pyproject-nix"; + nixpkgs.follows = "nixpkgs"; + }; + }; + pyproject-build-systems = { + url = "github:pyproject-nix/build-system-pkgs"; + inputs = { + pyproject-nix.follows = "pyproject-nix"; + uv2nix.follows = "uv2nix"; + nixpkgs.follows = "nixpkgs"; + }; + }; }; outputs = @@ -17,8 +38,27 @@ self, nixpkgs, crossplane-cli, + pyproject-nix, + uv2nix, + pyproject-build-systems, }: let + # Set by CI to override the auto-generated dev version. + buildVersion = null; + + # The composition functions that make up Modelplane. + functionNames = [ + "compose-gke-cluster" + "compose-inference-class" + "compose-inference-cluster" + "compose-inference-gateway" + "compose-kserve-backend" + "compose-model-deployment" + "compose-model-endpoint" + "compose-model-replica" + "compose-model-service" + ]; + supportedSystems = [ "x86_64-linux" "aarch64-linux" @@ -26,75 +66,109 @@ "aarch64-darwin" ]; - # Helpers for per-system outputs. + # Function images contain Linux Python interpreters. They can only be + # built on Linux hosts. macOS users can still use apps, checks, and the + # dev shell. + linuxSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + # Semantic version for packages. Uses buildVersion if set by CI, + # otherwise generates a dev version from git metadata. + version = + if buildVersion != null then + buildVersion + else if self ? shortRev then + "v0.1.0-dev.${builtins.toString self.lastModified}.g${self.shortRev}" + else + "v0.1.0-dev.${builtins.toString self.lastModified}.g${self.dirtyShortRev}"; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: forSystem system f); + forLinuxSystems = f: nixpkgs.lib.genAttrs linuxSystems (system: forSystem system f); forSystem = system: f: f { inherit system; - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs { + inherit system; + config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "upbound" ]; + }; }; in { - # CI checks (nix flake check). checks = forAllSystems ( + { pkgs, ... }: + import ./nix/checks.nix { + inherit + pkgs + self + functionNames + pyproject-nix + uv2nix + pyproject-build-systems + ; + } + ); + + # Function runtime images. Build individual images with + # nix build .#-, or all of them with nix build .#functions. + packages = forLinuxSystems ( { pkgs, ... }: let - checks = import ./nix/checks.nix { inherit pkgs self; }; + functions = import ./nix/functions.nix { + inherit + pkgs + self + functionNames + pyproject-nix + uv2nix + pyproject-build-systems + ; + }; in - { - python = checks.python { }; - shell-lint = checks.shellLint { }; - nix-lint = checks.nixLint { }; - } + functions.images // { functions = functions.all; } ); - # Development commands (nix run .#). apps = forAllSystems ( { pkgs, system, ... }: let - build = import ./nix/build.nix { inherit pkgs crossplane-cli; }; + deps = import ./nix/deps.nix { inherit pkgs crossplane-cli; }; apps = import ./nix/apps.nix { inherit pkgs; }; - crossplane = build.crossplane { inherit system; }; - dockerCredentialUp = build.dockerCredentialUp { inherit system; }; + crossplane = deps.crossplane { inherit system; }; + functionsPkg = self.packages.${system}.functions or null; in { - build-crossplane = apps.buildCrossplane { inherit crossplane dockerCredentialUp; }; - test-crossplane = apps.testCrossplane { inherit crossplane dockerCredentialUp; }; - push-crossplane = apps.pushCrossplane { inherit crossplane dockerCredentialUp; }; - format = apps.format { }; - lint = apps.lint { }; + fix = apps.fix { }; + generate = apps.generate { inherit crossplane pkgs; }; + build-crossplane = apps.buildCrossplane { inherit crossplane functionsPkg; }; + push-crossplane = apps.pushCrossplane { + inherit crossplane version; + dockerCredentialUp = pkgs.upbound; + }; } ); - # Development shell (nix develop). devShells = forAllSystems ( { pkgs, system, ... }: let - build = import ./nix/build.nix { inherit pkgs crossplane-cli; }; - crossplane = build.crossplane { inherit system; }; - dockerCredentialUp = build.dockerCredentialUp { inherit system; }; + deps = import ./nix/deps.nix { inherit pkgs crossplane-cli; }; + crossplane = deps.crossplane { inherit system; }; in { default = pkgs.mkShell { buildInputs = [ - # Crossplane crossplane - dockerCredentialUp - - # Kubernetes + pkgs.upbound pkgs.kubectl pkgs.kubernetes-helm pkgs.kind pkgs.docker-client - - # Python (for linting and testing composition functions) + pkgs.uv pkgs.python3 pkgs.ruff pkgs.pyright - - # Nix pkgs.nixfmt-rfc-style ]; @@ -109,9 +183,9 @@ echo "Modelplane development shell" echo "" - echo " nix run .#build-crossplane nix run .#format" - echo " nix run .#test-crossplane nix run .#lint" - echo " nix run .#push-crossplane nix flake check" + echo " nix flake check nix run .#fix" + echo " nix run .#generate nix run .#build-crossplane" + echo " nix run .#push-crossplane" echo "" ''; }; diff --git a/functions/compose-gke-cluster/pyproject.toml b/functions/compose-gke-cluster/pyproject.toml index 14df34560..bbaa3f07f 100644 --- a/functions/compose-gke-cluster/pyproject.toml +++ b/functions/compose-gke-cluster/pyproject.toml @@ -8,13 +8,16 @@ description = "Compose a GKE cluster with networking, node pools, and service ac requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-inference-class/pyproject.toml b/functions/compose-inference-class/pyproject.toml index 44a08d3c9..63fb9e5f8 100644 --- a/functions/compose-inference-class/pyproject.toml +++ b/functions/compose-inference-class/pyproject.toml @@ -8,13 +8,16 @@ description = "Mark an InferenceClass as ready." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-inference-cluster/pyproject.toml b/functions/compose-inference-cluster/pyproject.toml index 52e5822b6..7a0e709af 100644 --- a/functions/compose-inference-cluster/pyproject.toml +++ b/functions/compose-inference-cluster/pyproject.toml @@ -8,13 +8,16 @@ description = "Compose an InferenceCluster from a cluster source and KServe back requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-inference-gateway/pyproject.toml b/functions/compose-inference-gateway/pyproject.toml index d88b3d154..765ff22ed 100644 --- a/functions/compose-inference-gateway/pyproject.toml +++ b/functions/compose-inference-gateway/pyproject.toml @@ -8,13 +8,16 @@ description = "Compose the control plane routing gateway with Envoy Gateway and requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-kserve-backend/pyproject.toml b/functions/compose-kserve-backend/pyproject.toml index b28571f4d..1eadd5365 100644 --- a/functions/compose-kserve-backend/pyproject.toml +++ b/functions/compose-kserve-backend/pyproject.toml @@ -8,13 +8,16 @@ description = "Install KServe and supporting components on a remote cluster." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-model-deployment/pyproject.toml b/functions/compose-model-deployment/pyproject.toml index dd1683293..35a3eea1d 100644 --- a/functions/compose-model-deployment/pyproject.toml +++ b/functions/compose-model-deployment/pyproject.toml @@ -8,13 +8,16 @@ description = "Fan out a ModelDeployment to ModelReplicas and ModelEndpoints." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-model-endpoint/pyproject.toml b/functions/compose-model-endpoint/pyproject.toml index 5d585706a..c87f56237 100644 --- a/functions/compose-model-endpoint/pyproject.toml +++ b/functions/compose-model-endpoint/pyproject.toml @@ -8,13 +8,16 @@ description = "Compose an Envoy Gateway Backend from a ModelEndpoint." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-model-replica/pyproject.toml b/functions/compose-model-replica/pyproject.toml index 8fb4f073c..24016c947 100644 --- a/functions/compose-model-replica/pyproject.toml +++ b/functions/compose-model-replica/pyproject.toml @@ -8,13 +8,16 @@ description = "Deploy a model on a single InferenceCluster via KServe." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/functions/compose-model-service/pyproject.toml b/functions/compose-model-service/pyproject.toml index 60fc04ef6..5c7e9001b 100644 --- a/functions/compose-model-service/pyproject.toml +++ b/functions/compose-model-service/pyproject.toml @@ -8,13 +8,16 @@ description = "Compose a Gateway API HTTPRoute from a ModelService." requires-python = ">=3.11,<3.14" license = "Apache-2.0" dependencies = [ - "crossplane-function-sdk-python==0.12.0", - "click==8.3.2", + "crossplane-function-sdk-python>=0.12.0", + "click>=8.1.0", "grpcio>=1.73.1", - "crossplane-models @ file:./../../schemas/python", + "crossplane-models", ] dynamic = ["version"] +[tool.uv.sources] +crossplane-models = { workspace = true } + [project.scripts] function = "function.main:cli" @@ -25,5 +28,3 @@ packages = ["function"] path = "function/__version__.py" validate-bump = false -[tool.hatch.metadata] -allow-direct-references = true diff --git a/nix/apps.nix b/nix/apps.nix index 107e246bd..35f4b289c 100644 --- a/nix/apps.nix +++ b/nix/apps.nix @@ -1,29 +1,42 @@ -# Interactive development commands for Modelplane. +# Development commands (nix run .#). # # Apps run outside the Nix sandbox with full filesystem and network access. -# They're designed for local development. -# -# All apps are builder functions that take an attrset of arguments and return a -# complete app definition ({ type, meta.description, program }). Most use -# writeShellApplication to create the program. The text block is preprocessed: -# -# ${somePkg}/bin/foo -> /nix/store/.../bin/foo (Nix store path) -# ''${SOME_VAR} -> ${SOME_VAR} (shell variable, escaped) -# -# Each app declares its tool dependencies via runtimeInputs, with inheritPath -# set to false. This ensures apps only use explicitly declared tools. +# Each app declares its tool dependencies via runtimeInputs with inheritPath +# set to false, ensuring apps only use explicitly declared tools. { pkgs }: { - # Format Python code. - format = _: { + # Auto-fix linting and formatting issues across all languages. + fix = _: { type = "app"; - meta.description = "Format Python code"; + meta.description = "Auto-fix lint and formatting issues"; program = pkgs.lib.getExe ( pkgs.writeShellApplication { - name = "modelplane-format"; - runtimeInputs = [ pkgs.ruff ]; + name = "modelplane-fix"; + runtimeInputs = [ + pkgs.findutils + pkgs.ruff + pkgs.statix + pkgs.deadnix + pkgs.nixfmt-rfc-style + pkgs.shellcheck + pkgs.shfmt + pkgs.gnupatch + ]; inheritPath = false; text = '' + echo "Formatting and linting Nix..." + statix fix . + deadnix --edit flake.nix nix/*.nix + nixfmt flake.nix nix/*.nix + + echo "Formatting and linting shell..." + find . -name '*.sh' -type f | while read -r script; do + shellcheck --format=diff "$script" | patch -p1 || true + shfmt -w "$script" + done + find . -name '*.sh' -type f -exec shellcheck {} + + + echo "Formatting and linting Python..." ruff format functions/ ruff check --fix functions/ ''; @@ -31,106 +44,75 @@ ); }; - # Lint Python code. - lint = _: { - type = "app"; - meta.description = "Lint Python code"; - program = pkgs.lib.getExe ( - pkgs.writeShellApplication { - name = "modelplane-lint"; - runtimeInputs = [ pkgs.ruff ]; - inheritPath = false; - text = '' - ruff format --check functions/ - ruff check functions/ - ''; - } - ); - }; - - # Build the Crossplane project (XRDs, functions, and compositions). - buildCrossplane = - { crossplane, dockerCredentialUp }: + # Regenerate schemas from XRDs and dependencies. The Crossplane CLI writes + # language bindings to schemas/; only schemas/python/ is committed to git. + generate = + { crossplane, pkgs }: { type = "app"; - meta.description = "Build the Crossplane project"; + meta.description = "Regenerate schemas from XRDs and dependencies"; program = pkgs.lib.getExe ( pkgs.writeShellApplication { - name = "modelplane-build-crossplane"; + name = "modelplane-generate"; runtimeInputs = [ crossplane - dockerCredentialUp + pkgs.upbound + pkgs.findutils ]; inheritPath = false; text = '' - crossplane project build "$@" + crossplane dependency update-cache + find schemas/python/models -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true + echo "Done. Review changes with 'git diff schemas/python/'." ''; } ); }; - # Run unit tests. Builds the project first to generate Pydantic models, - # then creates a venv with function dependencies and runs unittest - # across all functions. - testCrossplane = - { crossplane, dockerCredentialUp }: + # Build the Crossplane project. On Linux, materialises Nix-built function + # runtime images into _output/functions/ before invoking the CLI. The CLI + # loads them via the Tarball function source in crossplane-project.yaml. + buildCrossplane = + { crossplane, functionsPkg }: { type = "app"; - meta.description = "Build the Crossplane project and run unit tests"; + meta.description = "Build the Crossplane project"; program = pkgs.lib.getExe ( pkgs.writeShellApplication { - name = "modelplane-test-crossplane"; + name = "modelplane-build-crossplane"; runtimeInputs = [ crossplane - dockerCredentialUp - pkgs.python3 + pkgs.coreutils ]; inheritPath = false; - text = '' - crossplane project build - - echo "" - echo "Setting up test environment..." - python3 -m venv .venv-test - .venv-test/bin/pip install --quiet \ - crossplane-function-sdk-python==0.11.0 \ - schemas/python - - # grpcio's C extension needs libstdc++. - export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - - echo "" - echo "Running unit tests..." - failed=0 - for fn in functions/compose-*; do - echo "" - echo "--- ''${fn} ---" - if [ -d "''${fn}/tests" ]; then - (cd "$fn" && ../../.venv-test/bin/python -m unittest discover -s tests -v) || failed=1 + text = + ( + if functionsPkg != null then + '' + mkdir -p _output + rm -f _output/functions + ln -s ${functionsPkg} _output/functions + '' else - echo " (no tests)" - fi - done - - if [ "$failed" -ne 0 ]; then - echo "" - echo "FAIL: some tests failed" - exit 1 - fi - ''; + '' + echo "Note: function image builds are only supported on Linux." >&2 + '' + ) + + '' + crossplane project build "$@" + ''; } ); }; - # Push the Crossplane project to a registry. - # - # Auto-generates a dev version tag from git metadata: - # v0.1.0-dev..g - # - # Pass --tag to override, e.g.: - # nix run .#push-crossplane -- --tag v0.1.0 + # Push the Crossplane project to a registry. Uses a dev version tag unless + # --tag is passed, e.g.: nix run .#push-crossplane -- --tag v0.1.0 pushCrossplane = - { crossplane, dockerCredentialUp }: + { + crossplane, + dockerCredentialUp, + version, + }: { type = "app"; meta.description = "Push the Crossplane project to a registry"; @@ -140,23 +122,16 @@ runtimeInputs = [ crossplane dockerCredentialUp - pkgs.git ]; inheritPath = false; text = '' - # Auto-generate a dev tag from git metadata unless --tag is - # passed explicitly. if [[ ! " $* " =~ " --tag " ]]; then - count=$(git rev-list --count HEAD) - hash=$(git rev-parse --short HEAD) - tag="v0.1.0-dev.''${count}.g''${hash}" - echo "Pushing with tag: $tag" - set -- --tag "$tag" "$@" + echo "Pushing with tag: ${version}" + set -- --tag "${version}" "$@" fi crossplane project push "$@" ''; } ); }; - } diff --git a/nix/build.nix b/nix/build.nix deleted file mode 100644 index b0df57c45..000000000 --- a/nix/build.nix +++ /dev/null @@ -1,75 +0,0 @@ -# Build derivations for Modelplane. -# -# All builders are functions that take an attrset of arguments and return a -# derivation. The actual build definitions live in flake.nix. -{ pkgs, crossplane-cli, ... }: -let - # Map Nix system strings to the Go OS/arch pairs used in the crossplane-cli - # release bundle. - platformMap = { - "x86_64-linux" = "linux_amd64"; - "aarch64-linux" = "linux_arm64"; - "x86_64-darwin" = "darwin_amd64"; - "aarch64-darwin" = "darwin_arm64"; - }; - - # The docker-credential-up binary. The Crossplane CLI uses Docker's standard - # credential chain for OCI registry auth. This helper provides credentials - # for xpkg.upbound.io. - dockerCredentialUpVersion = "0.44.3"; - dockerCredentialUpBins = { - "x86_64-linux" = { - url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/linux_amd64/docker-credential-up"; - hash = "sha256-weGga6mxaNqoJx1X+mgtaOlxeXSRdHBSGUjX82V8S9A="; - }; - "aarch64-linux" = { - url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/linux_arm64/docker-credential-up"; - hash = "sha256-3r3ZqIAKIAt/Ec9WSRbVt/rnut1k+Kx4mLNjPgTtzUc="; - }; - "x86_64-darwin" = { - # TODO(negz): Prefetch and verify this hash. - url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/darwin_amd64/docker-credential-up"; - hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - }; - "aarch64-darwin" = { - url = "https://cli.upbound.io/stable/v${dockerCredentialUpVersion}/bin/darwin_arm64/docker-credential-up"; - hash = "sha256-mSIOSuc/nKgo0hw66gpVrZlGR0l+7ZAu16YBb/4K/GE="; - }; - }; -in -{ - # The Crossplane CLI. The upstream flake produces a multi-platform release - # bundle. We extract the binary for the current system. - crossplane = - { system }: - let - release = crossplane-cli.packages.${system}.default; - platform = platformMap.${system}; - in - pkgs.stdenvNoCC.mkDerivation { - pname = "crossplane"; - version = release.version or "0.0.0"; - dontUnpack = true; - installPhase = '' - install -Dm755 ${release}/bin/${platform}/crossplane $out/bin/crossplane - ''; - }; - - # The docker-credential-up binary for xpkg.upbound.io authentication. - dockerCredentialUp = - { system }: - let - bin = dockerCredentialUpBins.${system}; - in - pkgs.stdenvNoCC.mkDerivation { - pname = "docker-credential-up"; - version = dockerCredentialUpVersion; - src = pkgs.fetchurl { - inherit (bin) url hash; - }; - dontUnpack = true; - installPhase = '' - install -Dm755 $src $out/bin/docker-credential-up - ''; - }; -} diff --git a/nix/checks.nix b/nix/checks.nix index 4b41a6d7f..062b1e848 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -1,37 +1,61 @@ -# CI check builders for Modelplane. +# CI checks (nix flake check). # -# Checks run inside the Nix sandbox without network or filesystem access. This -# makes them fully reproducible but means Go modules and npm dependencies must -# be prefetched. -# -# All checks are builder functions that take an attrset of arguments and return -# a derivation. The actual check definitions live in flake.nix. -{ pkgs, self }: +# All checks run inside the Nix sandbox without network or filesystem access. +# Unit tests run against uv2nix-built venvs with test sources copied from the +# flake source tree. +{ + pkgs, + self, + functionNames, + pyproject-nix, + uv2nix, + pyproject-build-systems, +}: +let + workspace = uv2nix.lib.workspace.loadWorkspace { workspaceRoot = self; }; + pythonSet = + (pkgs.callPackage pyproject-nix.build.packages { python = pkgs.python312; }).overrideScope + ( + pkgs.lib.composeManyExtensions [ + pyproject-build-systems.overlays.wheel + (workspace.mkPyprojectOverlay { sourcePreference = "wheel"; }) + ] + ); + + # Each function exports a 'function' Python module, so tests must run from + # a directory where that module is importable via the venv. We copy tests/ + # from the source tree and run unittest against the venv's Python. + mkFunctionTest = + name: + let + venv = pythonSet.mkVirtualEnv "${name}-test-env" { + ${name} = [ ]; + }; + in + pkgs.runCommand "modelplane-test-${name}" { } '' + cp -r ${self}/functions/${name}/tests tests + ${venv}/bin/python -m unittest discover -s tests -v + mkdir -p $out + touch $out/.tests-passed + ''; +in { - # Run Python lint and formatting checks. Ruff works on source files only, - # no network access needed. Configuration lives in pyproject.toml. python = - _: pkgs.runCommand "modelplane-python-checks" { nativeBuildInputs = [ pkgs.ruff ]; } '' - # Copy source to a writable directory. Ruff needs to write a cache. cp -r ${self} src chmod -R u+w src cd src - echo "Checking Python formatting..." ruff format --check functions/ - echo "Running Python linter..." ruff check functions/ mkdir -p $out touch $out/.python-checks-passed ''; - # Run shell linters (shellcheck, shfmt). - shellLint = - _: + shell-lint = pkgs.runCommand "modelplane-shell-lint" { nativeBuildInputs = [ @@ -50,9 +74,7 @@ touch $out/.shell-lint-passed ''; - # Run Nix linters (statix, deadnix, nixfmt). - nixLint = - _: + nix-lint = pkgs.runCommand "modelplane-nix-lint" { nativeBuildInputs = [ @@ -69,3 +91,9 @@ touch $out/.nix-lint-passed ''; } +// builtins.listToAttrs ( + map (name: { + name = "test-${name}"; + value = mkFunctionTest name; + }) functionNames +) diff --git a/nix/deps.nix b/nix/deps.nix new file mode 100644 index 000000000..b2151b632 --- /dev/null +++ b/nix/deps.nix @@ -0,0 +1,28 @@ +# External dependencies not available in nixpkgs. +{ pkgs, crossplane-cli }: +let + platformMap = { + "x86_64-linux" = "linux_amd64"; + "aarch64-linux" = "linux_arm64"; + "x86_64-darwin" = "darwin_amd64"; + "aarch64-darwin" = "darwin_arm64"; + }; +in +{ + # The Crossplane CLI. The upstream flake produces a multi-platform release + # bundle; we extract the binary for the current system. + crossplane = + { system }: + let + release = crossplane-cli.packages.${system}.default; + platform = platformMap.${system}; + in + pkgs.stdenvNoCC.mkDerivation { + pname = "crossplane"; + version = release.version or "0.0.0"; + dontUnpack = true; + installPhase = '' + install -Dm755 ${release}/bin/${platform}/crossplane $out/bin/crossplane + ''; + }; +} diff --git a/nix/functions.nix b/nix/functions.nix new file mode 100644 index 000000000..62b747619 --- /dev/null +++ b/nix/functions.nix @@ -0,0 +1,119 @@ +# OCI image tarballs for each composition function. +# +# Builds one image per (function, architecture) pair using uv2nix. The uv.lock +# at the workspace root is the source of truth for Python dependencies. +# +# The resulting tarballs are consumed by `crossplane project build` via the +# Tarball function source in crossplane-project.yaml. +{ + pkgs, + self, + functionNames, + pyproject-nix, + uv2nix, + pyproject-build-systems, +}: +let + architectures = [ + "amd64" + "arm64" + ]; + + archToNixSystem = { + "amd64" = "x86_64-linux"; + "arm64" = "aarch64-linux"; + }; + + workspace = uv2nix.lib.workspace.loadWorkspace { workspaceRoot = self; }; + + # Build a Python package set for a given architecture. Uses pkgsCross when + # the target differs from the host so the Python interpreter matches the + # target while build tools (hatchling etc.) run on the host. + # + # Uses overlays.wheel (not overlays.default) because the default overlay + # builds hatchling from source, which is missing pathspec as a native build + # input for cross-compilation targets. + pythonSetForArch = + arch: + let + targetSystem = archToNixSystem.${arch}; + targetPkgs = + if targetSystem == pkgs.system then + pkgs + else + pkgs.pkgsCross.${ + { + "x86_64-linux" = "gnu64"; + "aarch64-linux" = "aarch64-multiplatform"; + } + .${targetSystem} + }; + in + (targetPkgs.callPackage pyproject-nix.build.packages { python = targetPkgs.python312; }) + .overrideScope + ( + pkgs.lib.composeManyExtensions [ + pyproject-build-systems.overlays.wheel + (workspace.mkPyprojectOverlay { sourcePreference = "wheel"; }) + ] + ); + + etcPasswd = pkgs.writeTextDir "etc/passwd" '' + root:x:0:0:root:/root:/sbin/nologin + nonroot:x:65532:65532:nonroot:/home/nonroot:/sbin/nologin + ''; + etcGroup = pkgs.writeTextDir "etc/group" '' + root:x:0: + nonroot:x:65532: + ''; + + mkFunctionImage = + { name, arch }: + let + venv = (pythonSetForArch arch).mkVirtualEnv "${name}-env" { + ${name} = [ ]; + }; + in + pkgs.dockerTools.buildLayeredImage { + name = "${name}-${arch}"; + tag = "latest"; + architecture = arch; + contents = [ + venv + etcPasswd + etcGroup + ]; + config = { + Entrypoint = [ "${venv}/bin/function" ]; + User = "nonroot:nonroot"; + WorkingDir = "/"; + ExposedPorts = { + "9443/tcp" = { }; + }; + }; + }; + + images = builtins.listToAttrs ( + builtins.concatMap ( + name: + map (arch: { + name = "${name}-${arch}"; + value = mkFunctionImage { inherit name arch; }; + }) architectures + ) functionNames + ); + + all = pkgs.runCommand "modelplane-functions" { } '' + mkdir -p $out + ${builtins.concatStringsSep "\n" ( + builtins.attrValues ( + builtins.mapAttrs (key: img: '' + ln -s ${img} $out/${key}.tar.gz + '') images + ) + )} + ''; +in +{ + inherit images all; +} diff --git a/pyproject.toml b/pyproject.toml index 81fa0385f..34e8fa419 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,21 @@ -# Tool configuration for ruff and pyright. The Crossplane CLI handles building -# and packaging composition functions — this file is for linting and -# type-checking. +[project] +name = "modelplane" +version = "0.0.0" +description = "An open-source AI inference platform built on Crossplane." +requires-python = ">=3.11,<3.14" +license = "Apache-2.0" + +[tool.uv] +# This is a workspace root; it's not installable itself. +package = false + +[tool.uv.workspace] +members = ["functions/*", "schemas/python"] + +[dependency-groups] +dev = [ + "crossplane-function-sdk-python>=0.12.0", +] [tool.ruff] target-version = "py312" diff --git a/schemas/.lock.json b/schemas/.lock.json new file mode 100644 index 000000000..a212df5cf --- /dev/null +++ b/schemas/.lock.json @@ -0,0 +1 @@ +{"packages":{"fs://apis":"90a83f65b668ef2d0d2410c0e9c2a470535717f55a06829b0cd8ec0431c5b7f8","git://https://github.com/crossplane/crossplane/cluster/crds":"32300d8ac6b01bb66702187eea8dee208511c75b","xpkg://xpkg.upbound.io/upbound/provider-gcp-cloudplatform:v2.5.0":"sha256:c84812c0e07576ae1c14103a6f1e69cd1a77b341c5b7939e29c269dd8dc30e03","xpkg://xpkg.upbound.io/upbound/provider-gcp-compute:v2.5.0":"sha256:324c89628bad85f27202dd4322caf969e7d354c9d9895695984301533c939799","xpkg://xpkg.upbound.io/upbound/provider-gcp-container:v2.5.0":"sha256:6e3bb9a041cc1c06b2940904b9c865fe0ea0dd7229e7017dd768e7a55eb18669","xpkg://xpkg.upbound.io/upbound/provider-helm:v1.2.3":"sha256:d81cbe87c15c8555c8388bbb372387084ce8fefdf9a08d0a540a6b4d228a0049","xpkg://xpkg.upbound.io/upbound/provider-helm:v1.2.4":"sha256:e5896e93156845d4f3005abbffa5f1d9468b79944be54203c675f8b61ea54e19","xpkg://xpkg.upbound.io/upbound/provider-kubernetes:v1.2.4":"sha256:b32140022ee86530424da210ed8544f561592a350dc3467365719ffde8c124e1","xpkg://xpkg.upbound.io/upbound/provider-kubernetes:v1.2.5":"sha256:8c9788629608066abc5ba8ae7039214aeaa89619d810a0bfc337102c4f4a897d"}} \ No newline at end of file diff --git a/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py b/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py index cc3f259fe..c9d0a9811 100644 --- a/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py +++ b/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py @@ -1,5 +1,5 @@ # generated by datamodel-codegen: -# filename: workdir/infrastructure_modelplane_ai_v1alpha1_gkecluster.yaml +# filename: workdir/apiextensions_crossplane_io_v1_compositeresourcedefinition.yaml from __future__ import annotations diff --git a/uv.lock b/uv.lock new file mode 100644 index 000000000..16677c327 --- /dev/null +++ b/uv.lock @@ -0,0 +1,432 @@ +version = 1 +revision = 3 +requires-python = ">=3.11, <3.14" + +[manifest] +members = [ + "compose-gke-cluster", + "compose-inference-class", + "compose-inference-cluster", + "compose-inference-gateway", + "compose-kserve-backend", + "compose-model-deployment", + "compose-model-endpoint", + "compose-model-replica", + "compose-model-service", + "crossplane-models", + "modelplane", +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "click" +version = "8.4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9b/98/518d8e5081007684232226f475082b30087d0f585e8457db087298259f49/click-8.4.1.tar.gz", hash = "sha256:918b5633eddf6b41c32d4f454bf0de810065c74e3f7dbf8ee5452f8be88d3e96", size = 353007, upload-time = "2026-05-22T04:08:37.769Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/0d/67e5b4109ea4a837e80daa87c2c696711955e40449a97e8926672534def2/click-8.4.1-py3-none-any.whl", hash = "sha256:482be17c6991b8c19c5429a1e995d9b0efdbb63172824c41f99965dc0ade8ec2", size = 116639, upload-time = "2026-05-22T04:08:35.26Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "compose-gke-cluster" +source = { editable = "functions/compose-gke-cluster" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-inference-class" +source = { editable = "functions/compose-inference-class" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-inference-cluster" +source = { editable = "functions/compose-inference-cluster" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-inference-gateway" +source = { editable = "functions/compose-inference-gateway" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-kserve-backend" +source = { editable = "functions/compose-kserve-backend" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-model-deployment" +source = { editable = "functions/compose-model-deployment" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-model-endpoint" +source = { editable = "functions/compose-model-endpoint" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-model-replica" +source = { editable = "functions/compose-model-replica" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "compose-model-service" +source = { editable = "functions/compose-model-service" } +dependencies = [ + { name = "click" }, + { name = "crossplane-function-sdk-python" }, + { name = "crossplane-models" }, + { name = "grpcio" }, +] + +[package.metadata] +requires-dist = [ + { name = "click", specifier = ">=8.1.0" }, + { name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }, + { name = "crossplane-models", editable = "schemas/python" }, + { name = "grpcio", specifier = ">=1.73.1" }, +] + +[[package]] +name = "crossplane-function-sdk-python" +version = "0.12.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "grpcio" }, + { name = "grpcio-reflection" }, + { name = "protobuf" }, + { name = "pydantic" }, + { name = "structlog" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d4/e6/560dd1ba24dd4267be4c257319af8e5bcc69ca9e5f022e662e684cbd3183/crossplane_function_sdk_python-0.12.0.tar.gz", hash = "sha256:667801e58c0358bdb0f11bf7ac944c0380372676006b025ff9b80581687bac97", size = 57268, upload-time = "2026-05-21T22:23:03.525Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d9/9c/f7c1ecaa7531d2b668665adb2554f536f5ad7d77ad513c150c913416f77e/crossplane_function_sdk_python-0.12.0-py3-none-any.whl", hash = "sha256:b0c399c94f23f3c658c0013cd1b1f60a03daa05501ebf910be467d29593f89ef", size = 42733, upload-time = "2026-05-21T22:23:01.64Z" }, +] + +[[package]] +name = "crossplane-models" +version = "0.0.0" +source = { editable = "schemas/python" } + +[[package]] +name = "grpcio" +version = "1.80.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b7/48/af6173dbca4454f4637a4678b67f52ca7e0c1ed7d5894d89d434fecede05/grpcio-1.80.0.tar.gz", hash = "sha256:29aca15edd0688c22ba01d7cc01cb000d72b2033f4a3c72a81a19b56fd143257", size = 12978905, upload-time = "2026-03-30T08:49:10.502Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5d/db/1d56e5f5823257b291962d6c0ce106146c6447f405b60b234c4f222a7cde/grpcio-1.80.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:dfab85db094068ff42e2a3563f60ab3dddcc9d6488a35abf0132daec13209c8a", size = 6055009, upload-time = "2026-03-30T08:46:46.265Z" }, + { url = "https://files.pythonhosted.org/packages/6e/18/c83f3cad64c5ca63bca7e91e5e46b0d026afc5af9d0a9972472ceba294b3/grpcio-1.80.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:5c07e82e822e1161354e32da2662f741a4944ea955f9f580ec8fb409dd6f6060", size = 12035295, upload-time = "2026-03-30T08:46:49.099Z" }, + { url = "https://files.pythonhosted.org/packages/0f/8e/e14966b435be2dda99fbe89db9525ea436edc79780431a1c2875a3582644/grpcio-1.80.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ba0915d51fd4ced2db5ff719f84e270afe0e2d4c45a7bdb1e8d036e4502928c2", size = 6610297, upload-time = "2026-03-30T08:46:52.123Z" }, + { url = "https://files.pythonhosted.org/packages/cc/26/d5eb38f42ce0e3fdc8174ea4d52036ef8d58cc4426cb800f2610f625dd75/grpcio-1.80.0-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:3cb8130ba457d2aa09fa6b7c3ed6b6e4e6a2685fce63cb803d479576c4d80e21", size = 7300208, upload-time = "2026-03-30T08:46:54.859Z" }, + { url = "https://files.pythonhosted.org/packages/25/51/bd267c989f85a17a5b3eea65a6feb4ff672af41ca614e5a0279cc0ea381c/grpcio-1.80.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:09e5e478b3d14afd23f12e49e8b44c8684ac3c5f08561c43a5b9691c54d136ab", size = 6813442, upload-time = "2026-03-30T08:46:57.056Z" }, + { url = "https://files.pythonhosted.org/packages/9e/d9/d80eef735b19e9169e30164bbf889b46f9df9127598a83d174eb13a48b26/grpcio-1.80.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:00168469238b022500e486c1c33916acf2f2a9b2c022202cf8a1885d2e3073c1", size = 7414743, upload-time = "2026-03-30T08:46:59.682Z" }, + { url = "https://files.pythonhosted.org/packages/de/f2/567f5bd5054398ed6b0509b9a30900376dcf2786bd936812098808b49d8d/grpcio-1.80.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8502122a3cc1714038e39a0b071acb1207ca7844208d5ea0d091317555ee7106", size = 8426046, upload-time = "2026-03-30T08:47:02.474Z" }, + { url = "https://files.pythonhosted.org/packages/62/29/73ef0141b4732ff5eacd68430ff2512a65c004696997f70476a83e548e7e/grpcio-1.80.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ce1794f4ea6cc3ca29463f42d665c32ba1b964b48958a66497917fe9069f26e6", size = 7851641, upload-time = "2026-03-30T08:47:05.462Z" }, + { url = "https://files.pythonhosted.org/packages/46/69/abbfa360eb229a8623bab5f5a4f8105e445bd38ce81a89514ba55d281ad0/grpcio-1.80.0-cp311-cp311-win32.whl", hash = "sha256:51b4a7189b0bef2aa30adce3c78f09c83526cf3dddb24c6a96555e3b97340440", size = 4154368, upload-time = "2026-03-30T08:47:08.027Z" }, + { url = "https://files.pythonhosted.org/packages/6f/d4/ae92206d01183b08613e846076115f5ac5991bae358d2a749fa864da5699/grpcio-1.80.0-cp311-cp311-win_amd64.whl", hash = "sha256:02e64bb0bb2da14d947a49e6f120a75e947250aebe65f9629b62bb1f5c14e6e9", size = 4894235, upload-time = "2026-03-30T08:47:10.839Z" }, + { url = "https://files.pythonhosted.org/packages/5c/e8/a2b749265eb3415abc94f2e619bbd9e9707bebdda787e61c593004ec927a/grpcio-1.80.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:c624cc9f1008361014378c9d776de7182b11fe8b2e5a81bc69f23a295f2a1ad0", size = 6015616, upload-time = "2026-03-30T08:47:13.428Z" }, + { url = "https://files.pythonhosted.org/packages/3e/97/b1282161a15d699d1e90c360df18d19165a045ce1c343c7f313f5e8a0b77/grpcio-1.80.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:f49eddcac43c3bf350c0385366a58f36bed8cc2c0ec35ef7b74b49e56552c0c2", size = 12014204, upload-time = "2026-03-30T08:47:15.873Z" }, + { url = "https://files.pythonhosted.org/packages/6e/5e/d319c6e997b50c155ac5a8cb12f5173d5b42677510e886d250d50264949d/grpcio-1.80.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d334591df610ab94714048e0d5b4f3dd5ad1bee74dfec11eee344220077a79de", size = 6563866, upload-time = "2026-03-30T08:47:18.588Z" }, + { url = "https://files.pythonhosted.org/packages/ae/f6/fdd975a2cb4d78eb67769a7b3b3830970bfa2e919f1decf724ae4445f42c/grpcio-1.80.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:0cb517eb1d0d0aaf1d87af7cc5b801d686557c1d88b2619f5e31fab3c2315921", size = 7273060, upload-time = "2026-03-30T08:47:21.113Z" }, + { url = "https://files.pythonhosted.org/packages/db/f0/a3deb5feba60d9538a962913e37bd2e69a195f1c3376a3dd44fe0427e996/grpcio-1.80.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4e78c4ac0d97dc2e569b2f4bcbbb447491167cb358d1a389fc4af71ab6f70411", size = 6782121, upload-time = "2026-03-30T08:47:23.827Z" }, + { url = "https://files.pythonhosted.org/packages/ca/84/36c6dcfddc093e108141f757c407902a05085e0c328007cb090d56646cdf/grpcio-1.80.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2ed770b4c06984f3b47eb0517b1c69ad0b84ef3f40128f51448433be904634cd", size = 7383811, upload-time = "2026-03-30T08:47:26.517Z" }, + { url = "https://files.pythonhosted.org/packages/7c/ef/f3a77e3dc5b471a0ec86c564c98d6adfa3510d38f8ee99010410858d591e/grpcio-1.80.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:256507e2f524092f1473071a05e65a5b10d84b82e3ff24c5b571513cfaa61e2f", size = 8393860, upload-time = "2026-03-30T08:47:29.439Z" }, + { url = "https://files.pythonhosted.org/packages/9b/8d/9d4d27ed7f33d109c50d6b5ce578a9914aa68edab75d65869a17e630a8d1/grpcio-1.80.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9a6284a5d907c37db53350645567c522be314bac859a64a7a5ca63b77bb7958f", size = 7830132, upload-time = "2026-03-30T08:47:33.254Z" }, + { url = "https://files.pythonhosted.org/packages/14/e4/9990b41c6d7a44e1e9dee8ac11d7a9802ba1378b40d77468a7761d1ad288/grpcio-1.80.0-cp312-cp312-win32.whl", hash = "sha256:c71309cfce2f22be26aa4a847357c502db6c621f1a49825ae98aa0907595b193", size = 4140904, upload-time = "2026-03-30T08:47:35.319Z" }, + { url = "https://files.pythonhosted.org/packages/2f/2c/296f6138caca1f4b92a31ace4ae1b87dab692fc16a7a3417af3bb3c805bf/grpcio-1.80.0-cp312-cp312-win_amd64.whl", hash = "sha256:9fe648599c0e37594c4809d81a9e77bd138cc82eb8baa71b6a86af65426723ff", size = 4880944, upload-time = "2026-03-30T08:47:37.831Z" }, + { url = "https://files.pythonhosted.org/packages/2f/3a/7c3c25789e3f069e581dc342e03613c5b1cb012c4e8c7d9d5cf960a75856/grpcio-1.80.0-cp313-cp313-linux_armv7l.whl", hash = "sha256:e9e408fc016dffd20661f0126c53d8a31c2821b5c13c5d67a0f5ed5de93319ad", size = 6017243, upload-time = "2026-03-30T08:47:40.075Z" }, + { url = "https://files.pythonhosted.org/packages/04/19/21a9806eb8240e174fd1ab0cd5b9aa948bb0e05c2f2f55f9d5d7405e6d08/grpcio-1.80.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:92d787312e613754d4d8b9ca6d3297e69994a7912a32fa38c4c4e01c272974b0", size = 12010840, upload-time = "2026-03-30T08:47:43.11Z" }, + { url = "https://files.pythonhosted.org/packages/18/3a/23347d35f76f639e807fb7a36fad3068aed100996849a33809591f26eca6/grpcio-1.80.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8ac393b58aa16991a2f1144ec578084d544038c12242da3a215966b512904d0f", size = 6567644, upload-time = "2026-03-30T08:47:46.806Z" }, + { url = "https://files.pythonhosted.org/packages/ff/40/96e07ecb604a6a67ae6ab151e3e35b132875d98bc68ec65f3e5ab3e781d7/grpcio-1.80.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:68e5851ac4b9afe07e7f84483803ad167852570d65326b34d54ca560bfa53fb6", size = 7277830, upload-time = "2026-03-30T08:47:49.643Z" }, + { url = "https://files.pythonhosted.org/packages/9b/e2/da1506ecea1f34a5e365964644b35edef53803052b763ca214ba3870c856/grpcio-1.80.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:873ff5d17d68992ef6605330127425d2fc4e77e612fa3c3e0ed4e668685e3140", size = 6783216, upload-time = "2026-03-30T08:47:52.817Z" }, + { url = "https://files.pythonhosted.org/packages/44/83/3b20ff58d0c3b7f6caaa3af9a4174d4023701df40a3f39f7f1c8e7c48f9d/grpcio-1.80.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2bea16af2750fd0a899bf1abd9022244418b55d1f37da2202249ba4ba673838d", size = 7385866, upload-time = "2026-03-30T08:47:55.687Z" }, + { url = "https://files.pythonhosted.org/packages/47/45/55c507599c5520416de5eefecc927d6a0d7af55e91cfffb2e410607e5744/grpcio-1.80.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ba0db34f7e1d803a878284cd70e4c63cb6ae2510ba51937bf8f45ba997cefcf7", size = 8391602, upload-time = "2026-03-30T08:47:58.303Z" }, + { url = "https://files.pythonhosted.org/packages/10/bb/dd06f4c24c01db9cf11341b547d0a016b2c90ed7dbbb086a5710df7dd1d7/grpcio-1.80.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8eb613f02d34721f1acf3626dfdb3545bd3c8505b0e52bf8b5710a28d02e8aa7", size = 7826752, upload-time = "2026-03-30T08:48:01.311Z" }, + { url = "https://files.pythonhosted.org/packages/f9/1e/9d67992ba23371fd63d4527096eb8c6b76d74d52b500df992a3343fd7251/grpcio-1.80.0-cp313-cp313-win32.whl", hash = "sha256:93b6f823810720912fd131f561f91f5fed0fda372b6b7028a2681b8194d5d294", size = 4142310, upload-time = "2026-03-30T08:48:04.594Z" }, + { url = "https://files.pythonhosted.org/packages/cf/e6/283326a27da9e2c3038bc93eeea36fb118ce0b2d03922a9cda6688f53c5b/grpcio-1.80.0-cp313-cp313-win_amd64.whl", hash = "sha256:e172cf795a3ba5246d3529e4d34c53db70e888fa582a8ffebd2e6e48bc0cba50", size = 4882833, upload-time = "2026-03-30T08:48:07.363Z" }, +] + +[[package]] +name = "grpcio-reflection" +version = "1.62.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "grpcio" }, + { name = "protobuf" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/70/fb/f45ea9ef97943967391658333c57bc88ad0af36c94e4cb06eecb5966692e/grpcio-reflection-1.62.3.tar.gz", hash = "sha256:cb84682933c400bddf94dd94f928d1c6570f500b6dd255973d4bfb495b82585f", size = 17719, upload-time = "2024-08-06T00:37:05.72Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/54/acc6a6e684827b0f6bb4e2c27f3d7e25b71322c4078ef5b455c07c43260e/grpcio_reflection-1.62.3-py3-none-any.whl", hash = "sha256:a48ef37df81a3bada78261fc92ef382f061112f989d1312398b945cc69838b9c", size = 22232, upload-time = "2024-08-06T00:30:13.131Z" }, +] + +[[package]] +name = "modelplane" +version = "0.0.0" +source = { virtual = "." } + +[package.dev-dependencies] +dev = [ + { name = "crossplane-function-sdk-python" }, +] + +[package.metadata] + +[package.metadata.requires-dev] +dev = [{ name = "crossplane-function-sdk-python", specifier = ">=0.12.0" }] + +[[package]] +name = "protobuf" +version = "7.35.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/60/fd/5b1491d9e4b586d621c54f4c36b888714164b6875f8d6afa3f9072906a51/protobuf-7.35.0.tar.gz", hash = "sha256:a2efd84605f41e559f1881b0912b44099d0a2ac9bf46b3474823f10fb393b0e6", size = 458677, upload-time = "2026-05-19T23:02:29.197Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/83/ee/93d06e358a4aa32280b00e722d3ea0a1f25fc3cc5778d80581c9cca2c10e/protobuf-7.35.0-cp310-abi3-macosx_10_9_universal2.whl", hash = "sha256:66be6c513931c794fa92c080ffee41671390da3d79da219cf9c0c0907f035dda", size = 433225, upload-time = "2026-05-19T23:02:19.884Z" }, + { url = "https://files.pythonhosted.org/packages/8b/39/1c76c2da93f3c507e958e0aecee2391cc44d4625de6c728bbc555195b5a8/protobuf-7.35.0-cp310-abi3-manylinux2014_aarch64.whl", hash = "sha256:fcbe42a4ac09d3ec9c987ddfcd956afd0b15f1ff613bd8371bde9405ffd5c8e5", size = 328847, upload-time = "2026-05-19T23:02:22.3Z" }, + { url = "https://files.pythonhosted.org/packages/91/1a/39f7ce90a238c1a987a4d81ec26379e02ca0aff367de68e4a1fa474215b9/protobuf-7.35.0-cp310-abi3-manylinux2014_s390x.whl", hash = "sha256:4cbf5cc286130e06a6c9bbefac442431173906dfcc979712183d4adcc01b37ee", size = 344030, upload-time = "2026-05-19T23:02:23.591Z" }, + { url = "https://files.pythonhosted.org/packages/70/5b/6baf9008817964454055ff3fe65f1de0b5f1e26c80c82f7fb108b7cd4ea3/protobuf-7.35.0-cp310-abi3-manylinux2014_x86_64.whl", hash = "sha256:6c0f98f10c8a05ea30f8993dfef2de093d27b490fdae78bb60c8343795d55011", size = 327130, upload-time = "2026-05-19T23:02:24.637Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e5/e46adb0badc388bfb84877a5f9f026aff63f60e611016cf64dbe77e05446/protobuf-7.35.0-cp310-abi3-win32.whl", hash = "sha256:4c4617b83ade0e279d1d2bfe04025a1adb87f9ed657de038620dc0ff959357f6", size = 428946, upload-time = "2026-05-19T23:02:25.741Z" }, + { url = "https://files.pythonhosted.org/packages/a7/ab/547fbd9e16d879dd13c167478f8ae0a83a428008ca07a5e06acdc23ad473/protobuf-7.35.0-cp310-abi3-win_amd64.whl", hash = "sha256:f05bcadf9a2a6b8dda047007075135fb7d08c73d9177aabc067e1be46881a201", size = 439996, upload-time = "2026-05-19T23:02:26.808Z" }, + { url = "https://files.pythonhosted.org/packages/b8/ef/50433d346c56657a70d27f156c7b349ac59a068b01de4eb796e747eecc43/protobuf-7.35.0-py3-none-any.whl", hash = "sha256:c13f325cf242bad135c350629eeb5d54b24228eb472fb3e2e9ebbd4c5dc20ca0", size = 171659, upload-time = "2026-05-19T23:02:27.842Z" }, +] + +[[package]] +name = "pydantic" +version = "2.13.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/18/a5/b60d21ac674192f8ab0ba4e9fd860690f9b4a6e51ca5df118733b487d8d6/pydantic-2.13.4.tar.gz", hash = "sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6", size = 844775, upload-time = "2026-05-06T13:43:05.343Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fd/7b/122376b1fd3c62c1ed9dc80c931ace4844b3c55407b6fb2d199377c9736f/pydantic-2.13.4-py3-none-any.whl", hash = "sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba", size = 472262, upload-time = "2026-05-06T13:43:02.641Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.46.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9d/56/921726b776ace8d8f5db44c4ef961006580d91dc52b803c489fafd1aa249/pydantic_core-2.46.4.tar.gz", hash = "sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1", size = 471464, upload-time = "2026-05-06T13:37:06.98Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5c/fa/6d7708d2cfc1a832acb6aeb0cd16e801902df8a0f583bb3b4b527fde022e/pydantic_core-2.46.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:0e96592440881c74a213e5ad528e2b24d3d4f940de2766bed9010ab1d9e51594", size = 2111872, upload-time = "2026-05-06T13:40:27.596Z" }, + { url = "https://files.pythonhosted.org/packages/ae/6f/aa064a3e74b5745afbdf250594f38e7ead05e2d651bcb35994b9417a0d4d/pydantic_core-2.46.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e0d65b8c354be7fb5f720c3caa8bc940bc2d20ce749c8e06135f07f8ed95dd7c", size = 1948255, upload-time = "2026-05-06T13:39:12.574Z" }, + { url = "https://files.pythonhosted.org/packages/43/3a/41114a9f7569b84b4d84e7a018c57c56347dac30c0d4a872946ec4e36c46/pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bfb192b3f4b9e8a89b6277b6ce787564f62cfd272055f6e685726b111dc7826", size = 1972827, upload-time = "2026-05-06T13:38:19.841Z" }, + { url = "https://files.pythonhosted.org/packages/ef/25/1ab42e8048fe551934d9884e8d64daa7e990ad386f310a15981aeb6a5b08/pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9037063db01f09b09e237c282b6792bd4da634b5402c4e7f0c61effed7701a04", size = 2041051, upload-time = "2026-05-06T13:38:10.447Z" }, + { url = "https://files.pythonhosted.org/packages/94/c2/1a934597ddf08da410385b3b7aae91956a5a76c635effef456074fad7e88/pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc010ab034c8c7452522748bf937df58020d256ccae0874463d1f4d01758af8e", size = 2221314, upload-time = "2026-05-06T13:40:13.089Z" }, + { url = "https://files.pythonhosted.org/packages/02/6d/9e8ad178c9c4df27ad3c8f25d1fe2a7ab0d2ba0559fad4aee5d3d1f16771/pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8c5dac79fa1614d1e06ca695109c6105923bd9c7d1d6c918d4e637b7e6b32fd3", size = 2285146, upload-time = "2026-05-06T13:38:59.224Z" }, + { url = "https://files.pythonhosted.org/packages/80/50/540cd3aeefc041beb111125c4bff779831a2111fc6b15a9138cda277d32c/pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f9fa868638bf362d3d138ea55829cefb3d5f4b0d7f142234382a15e2485dbec4", size = 2089685, upload-time = "2026-05-06T13:38:17.762Z" }, + { url = "https://files.pythonhosted.org/packages/6b/a4/b440ad35f05f6a38f89fa0f149accb3f0e02be94ca5e15f3c449a61b4bc9/pydantic_core-2.46.4-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:17299feefe090f2caa5b8e37222bb5f663e4935a8bfa6931d4102e5df1a9f398", size = 2115420, upload-time = "2026-05-06T13:37:58.195Z" }, + { url = "https://files.pythonhosted.org/packages/99/61/de4f55db8dfd57bfdfa9a12ec90fe1b57c4f41062f7ca86f08586b3e0ac0/pydantic_core-2.46.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4c63ebc82684aa89d9a3bcbd13d515b3be44250dc68dd3bd81526c1cb31286c3", size = 2165122, upload-time = "2026-05-06T13:37:01.167Z" }, + { url = "https://files.pythonhosted.org/packages/f7/52/7c529d7bdb2d1068bd52f51fe32572c8301f9a4febf1948f10639f1436f5/pydantic_core-2.46.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:aaa2a54443eff1950ba5ddc6b6ccda0d9c84a364276a62f969bdf2a390650848", size = 2182573, upload-time = "2026-05-06T13:38:45.04Z" }, + { url = "https://files.pythonhosted.org/packages/37/b3/7c40325848ba78247f2812dcf9c7274e38cd801820ca6dd9fe63bcfb0eb4/pydantic_core-2.46.4-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:18e5ceec2ab67e6d5f1a9085e5a24c9c4e2ac4545730bfe668680bca05e555f3", size = 2317139, upload-time = "2026-05-06T13:37:15.539Z" }, + { url = "https://files.pythonhosted.org/packages/d9/37/f913f81a657c865b75da6c0dbed79876073c2a43b5bd9edbe8da785e4d49/pydantic_core-2.46.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a0f62d0a58f4e7da165457e995725421e0064f2255d8eccebc49f41bbc23b109", size = 2360433, upload-time = "2026-05-06T13:37:30.099Z" }, + { url = "https://files.pythonhosted.org/packages/c4/67/6acaa1be2567f9256b056d8477158cac7240813956ce86e49deae8e173b4/pydantic_core-2.46.4-cp311-cp311-win32.whl", hash = "sha256:041bde0a48fd37cf71cab1c9d56d3e8625a3793fef1f7dd232b3ff37e978ecda", size = 1985513, upload-time = "2026-05-06T13:38:15.669Z" }, + { url = "https://files.pythonhosted.org/packages/aa/e6/c505f83dfeda9a2e5c995cfd872949e4d05e12f7feb3dca72f633daefa94/pydantic_core-2.46.4-cp311-cp311-win_amd64.whl", hash = "sha256:6f2eeda33a839975441c86a4119e1383c50b47faf0cbb5176985565c6bb02c33", size = 2071114, upload-time = "2026-05-06T13:40:35.416Z" }, + { url = "https://files.pythonhosted.org/packages/0f/da/7a263a96d965d9d0df5e8de8a475f33495451117035b09acb110288c381f/pydantic_core-2.46.4-cp311-cp311-win_arm64.whl", hash = "sha256:14f4c5d6db102bd796a627bbb3a17b4cf4574b9ae861d8b7c9a9661c6dd3362d", size = 2044298, upload-time = "2026-05-06T13:38:29.754Z" }, + { url = "https://files.pythonhosted.org/packages/ce/8c/af022f0af448d7747c5154288d46b5f2bc5f17366eaa0e23e9aa04d59f3b/pydantic_core-2.46.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3245406455a5d98187ec35530fd772b1d799b26667980872c8d4614991e2c4a2", size = 2106158, upload-time = "2026-05-06T13:38:57.215Z" }, + { url = "https://files.pythonhosted.org/packages/19/95/6195171e385007300f0f5574592e467c568becce2d937a0b6804f218bc49/pydantic_core-2.46.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:962ccbab7b642487b1d8b7df90ef677e03134cf1fd8880bf698649b22a69371f", size = 1951724, upload-time = "2026-05-06T13:37:02.697Z" }, + { url = "https://files.pythonhosted.org/packages/8e/bc/f47d1ff9cbb1620e1b5b697eef06010035735f07820180e74178226b27b3/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8233f2947cf85404441fd7e0085f53b10c93e0ee78611099b5c7237e36aacbf7", size = 1975742, upload-time = "2026-05-06T13:37:09.448Z" }, + { url = "https://files.pythonhosted.org/packages/5b/11/9b9a5b0306345664a2da6410877af6e8082481b5884b3ddd78d47c6013ce/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a233125ac121aa3ffba9a2b59edfc4a985a76092dc8279586ab4b71390875e7", size = 2052418, upload-time = "2026-05-06T13:37:38.234Z" }, + { url = "https://files.pythonhosted.org/packages/f1/b7/a65fec226f5d78fc39f4a13c4cc0c768c22b113438f60c14adc9d2865038/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b712b53160b79a5850310b912a5ef8e57e56947c8ad690c227f5c9d7e561712", size = 2232274, upload-time = "2026-05-06T13:38:27.753Z" }, + { url = "https://files.pythonhosted.org/packages/68/f0/92039db98b907ef49269a8271f67db9cb78ae2fc68062ef7e4e77adb5f61/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9401557acd873c3a7f3eb9383edef8ac4968f9510e340f4808d427e75667e7b4", size = 2309940, upload-time = "2026-05-06T13:38:05.353Z" }, + { url = "https://files.pythonhosted.org/packages/5f/97/2aab507d3d00ca626e8e57c1eac6a79e4e5fbcc63eb99733ff55d1717f65/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:926c9541b14b12b1681dca8a0b75feb510b06c6341b70a8e500c2fdcff837cce", size = 2094516, upload-time = "2026-05-06T13:39:10.577Z" }, + { url = "https://files.pythonhosted.org/packages/22/37/a8aca44d40d737dde2bc05b3c6c07dff0de07ce6f82e9f3167aeaf4d5dea/pydantic_core-2.46.4-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:56cb4851bcaf3d117eddcef4fe66afd750a50274b0da8e22be256d10e5611987", size = 2136854, upload-time = "2026-05-06T13:40:22.59Z" }, + { url = "https://files.pythonhosted.org/packages/24/99/fcef1b79238c06a8cbec70819ac722ba76e02bc8ada9b0fd66eba40da01b/pydantic_core-2.46.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c68fcd102d71ea85c5b2dfac3f4f8476eff42a9e078fd5faefff6d145063536b", size = 2180306, upload-time = "2026-05-06T13:40:10.666Z" }, + { url = "https://files.pythonhosted.org/packages/ae/6c/fc44000918855b42779d007ae63b0532794739027b2f417321cddbc44f6a/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b2f69dec1725e79a012d920df1707de5caf7ed5e08f3be4435e25803efc47458", size = 2190044, upload-time = "2026-05-06T13:40:43.231Z" }, + { url = "https://files.pythonhosted.org/packages/6b/65/d9cadc9f1920d7a127ad2edba16c1db7916e59719285cd6c94600b0080ba/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:8d0820e8192167f80d88d64038e609c31452eeca865b4e1d9950a27a4609b00b", size = 2329133, upload-time = "2026-05-06T13:39:57.365Z" }, + { url = "https://files.pythonhosted.org/packages/d0/cf/c873d91679f3a30bcf5e7ac280ce5573483e72295307685120d0d5ad3416/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fbdb89b3e1c94a30cc5edfce477c6e6a5dc4d8f84665b455c27582f211a1c72c", size = 2374464, upload-time = "2026-05-06T13:38:06.976Z" }, + { url = "https://files.pythonhosted.org/packages/47/bd/6f2fc8188f31bf10590f1e98e7b306336161fac930a8c514cd7bd828c7dc/pydantic_core-2.46.4-cp312-cp312-win32.whl", hash = "sha256:9aa768456404a8bf48a4406685ac2bec8e72b62c69313734fa3b73cf33b3a894", size = 1974823, upload-time = "2026-05-06T13:40:47.985Z" }, + { url = "https://files.pythonhosted.org/packages/40/8c/985c1d41ea1107c2534abd9870e4ed5c8e7669b5c308297835c001e7a1c4/pydantic_core-2.46.4-cp312-cp312-win_amd64.whl", hash = "sha256:e9c26f834c65f5752f3f06cb08cb86a913ceb7274d0db6e267808a708b46bc89", size = 2072919, upload-time = "2026-05-06T13:39:21.153Z" }, + { url = "https://files.pythonhosted.org/packages/c4/ba/f463d006e0c47373ca7ec5e1a261c59dc01ef4d62b2657af925fb0deee3a/pydantic_core-2.46.4-cp312-cp312-win_arm64.whl", hash = "sha256:4fc73cb559bdb54b1134a706a2802a4cddd27a0633f5abb7e53056268751ac6a", size = 2027604, upload-time = "2026-05-06T13:39:03.753Z" }, + { url = "https://files.pythonhosted.org/packages/51/a2/5d30b469c5267a17b39dec53208222f76a8d351dfac4af661888c5aee77d/pydantic_core-2.46.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:5d5902252db0d3cedf8d4a1bc68f70eeb430f7e4c7104c8c476753519b423008", size = 2106306, upload-time = "2026-05-06T13:37:48.029Z" }, + { url = "https://files.pythonhosted.org/packages/c1/81/4fa520eaffa8bd7d1525e644cd6d39e7d60b1592bc5b516693c7340b50f1/pydantic_core-2.46.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c94f0688e7b8d0a67abf40e57a7eaaecd17cc9586706a31b76c031f63df052b4", size = 1951906, upload-time = "2026-05-06T13:37:17.012Z" }, + { url = "https://files.pythonhosted.org/packages/03/d5/fd02da45b659668b05923b17ba3a0100a0a3d5541e3bd8fcc4ecb711309e/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f027324c56cd5406ca49c124b0db10e56c69064fec039acc571c29020cc87c76", size = 1976802, upload-time = "2026-05-06T13:37:35.113Z" }, + { url = "https://files.pythonhosted.org/packages/21/f2/95727e1368be3d3ed485eaab7adbd7dda408f33f7a36e8b48e0144002b91/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e739fee756ba1010f8bcccb534252e85a35fe45ae92c295a06059ce58b74ccd3", size = 2052446, upload-time = "2026-05-06T13:37:12.313Z" }, + { url = "https://files.pythonhosted.org/packages/9c/86/5d99feea3f77c7234b8718075b23db11532773c1a0dbd9b9490215dc2eeb/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9d56801be94b86a9da183e5f3766e6310752b99ff647e38b09a9500d88e46e76", size = 2232757, upload-time = "2026-05-06T13:39:01.149Z" }, + { url = "https://files.pythonhosted.org/packages/d2/3a/508ac615935ef7588cf6d9e9b91309fdc2da751af865e02a9098de88258c/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2412e734dcb48da14d4e4006b82b46b74f2518b8a26ee7e58c6844a6cd6d03c4", size = 2309275, upload-time = "2026-05-06T13:37:41.406Z" }, + { url = "https://files.pythonhosted.org/packages/07/f8/41db9de19d7987d6b04715a02b3b40aea467000275d9d758ffaa31af7d50/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9551187363ffc0de2a00b2e47c25aeaeb1020b69b668762966df15fc5659dd5a", size = 2094467, upload-time = "2026-05-06T13:39:18.847Z" }, + { url = "https://files.pythonhosted.org/packages/2c/e2/f35033184cb11d0052daf4416e8e10a502ea2ac006fc4f459aee872727d1/pydantic_core-2.46.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:0186750b482eefa11d7f435892b09c5c606193ef3375bcf94aa00ae6bfb66262", size = 2134417, upload-time = "2026-05-06T13:40:17.944Z" }, + { url = "https://files.pythonhosted.org/packages/7e/7b/6ceeb1cc90e193862f444ebe373d8fdf613f0a82572dde03fb10734c6c71/pydantic_core-2.46.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5855698a4856556d86e8e6cd8434bc3ac0314ee8e12089ae0e143f64c6256e4e", size = 2179782, upload-time = "2026-05-06T13:40:32.618Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f2/c8d7773ede6af08036423a00ae0ceffce266c3c52a096c435d68c896083f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:cbaf13819775b7f769bf4a1f066cb6df7a28d4480081a589828ef190226881cd", size = 2188782, upload-time = "2026-05-06T13:36:51.018Z" }, + { url = "https://files.pythonhosted.org/packages/59/31/0c864784e31f09f05cdd87606f08923b9c9e7f6e51dd27f20f62f975ce9f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:633147d34cf4550417f12e2b1a0383973bdf5cdfde212cb09e9a581cf10820be", size = 2328334, upload-time = "2026-05-06T13:40:37.764Z" }, + { url = "https://files.pythonhosted.org/packages/c2/eb/4f6c8a41efa30baa755590f4141abf3a8c370fab610915733e74134a7270/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:82cf5301172168103724d49a1444d3378cb20cdee30b116a1bd6031236298a5d", size = 2372986, upload-time = "2026-05-06T13:39:34.152Z" }, + { url = "https://files.pythonhosted.org/packages/5b/24/b375a480d53113860c299764bfe9f349a3dc9108b3adc0d7f0d786492ebf/pydantic_core-2.46.4-cp313-cp313-win32.whl", hash = "sha256:9fa8ae11da9e2b3126c6426f147e0fba88d96d65921799bb30c6abd1cb2c97fb", size = 1973693, upload-time = "2026-05-06T13:37:55.072Z" }, + { url = "https://files.pythonhosted.org/packages/7e/e8/cff247591966f2d22ec8c003cd7587e27b7ba7b81ab2fb888e3ab75dc285/pydantic_core-2.46.4-cp313-cp313-win_amd64.whl", hash = "sha256:6b3ace8194b0e5204818c92802dcdca7fc6d88aabbb799d7c795540d9cd6d292", size = 2071819, upload-time = "2026-05-06T13:38:49.139Z" }, + { url = "https://files.pythonhosted.org/packages/c6/1a/f4aee670d5670e9e148e0c82c7db98d780be566c6e6a97ee8035528ca0b3/pydantic_core-2.46.4-cp313-cp313-win_arm64.whl", hash = "sha256:184c081504d17f1c1066e430e117142b2c77d9448a97f7b65c6ac9fd9aee238d", size = 2027411, upload-time = "2026-05-06T13:40:45.796Z" }, + { url = "https://files.pythonhosted.org/packages/ee/a4/73995fd4ebbb46ba0ee51e6fa049b8f02c40daebb762208feda8a6b7894d/pydantic_core-2.46.4-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:14d4edf427bdcf950a8a02d7cb44a08614388dd6e1bdcbf4f67504fa7887da9c", size = 2111589, upload-time = "2026-05-06T13:37:10.817Z" }, + { url = "https://files.pythonhosted.org/packages/fb/7f/f37d3a5e8bfcc2e403f5c57a730f2d815693fb42119e8ea48b3789335af1/pydantic_core-2.46.4-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:0ce40cd7b21210e99342afafbd4d0f76d784eb5b1d60f3bdc566be4983c6c73b", size = 1944552, upload-time = "2026-05-06T13:36:56.717Z" }, + { url = "https://files.pythonhosted.org/packages/15/3c/d7eb777b3ff43e8433a4efb39a17aa8fd98a4ee8561a24a67ef5db07b2d6/pydantic_core-2.46.4-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90884113d8b48f760e9587002789ddd741e76ab9f89518cd1e43b1f1a52ec44b", size = 1982984, upload-time = "2026-05-06T13:39:06.207Z" }, + { url = "https://files.pythonhosted.org/packages/63/87/70b9f40170a81afd55ca26c9b2acb25c20d64bcfbf888fafecb3ba077d4c/pydantic_core-2.46.4-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:66ce7632c22d837c95301830e111ad0128a32b8207533b60896a96c4915192ea", size = 2138417, upload-time = "2026-05-06T13:39:45.476Z" }, + { url = "https://files.pythonhosted.org/packages/9d/1d/8987ad40f65ae1432753072f214fb5c74fe47ffbd0698bb9cbbb585664f8/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:1d8ba486450b14f3b1d63bc521d410ec7565e52f887b9fb671791886436a42f7", size = 2095527, upload-time = "2026-05-06T13:39:52.283Z" }, + { url = "https://files.pythonhosted.org/packages/64/d3/84c282a7eee1d3ac4c0377546ef5a1ea436ce26840d9ac3b7ed54a377507/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:3009f12e4e90b7f88b4f9adb1b0c4a3d58fe7820f3238c190047209d148026df", size = 1936024, upload-time = "2026-05-06T13:40:15.671Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ca/eac61596cdeb4d7e174d3dc0bd8a6238f14f75f97a24e7b7db4c7e7340a0/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad785e92e6dc634c21555edc8bd6b64957ab844541bcb96a1366c202951ae526", size = 1990696, upload-time = "2026-05-06T13:38:34.717Z" }, + { url = "https://files.pythonhosted.org/packages/fa/c3/7c8b240552251faf6b3a957db200fcfbbcec36763c050428b601e0c9b83b/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00c603d540afdd6b80eb39f078f33ebd46211f02f33e34a32d9f053bba711de0", size = 2147590, upload-time = "2026-05-06T13:39:29.883Z" }, + { url = "https://files.pythonhosted.org/packages/11/cb/428de0385b6c8d44b716feba566abfacfbd23ee3c4439faa789a1456242f/pydantic_core-2.46.4-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:0c563b08bca408dc7f65f700633d8442fffb2421fc47b8101377e9fd65051ff0", size = 2112782, upload-time = "2026-05-06T13:37:04.016Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b5/6a17bdadd0fc1f170adfd05a20d37c832f52b117b4d9131da1f41bb097ce/pydantic_core-2.46.4-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:db06ffe51636ffe9ca531fe9023dd64bdd794be8754cb5df57c5498ae5b518a7", size = 1952146, upload-time = "2026-05-06T13:39:43.092Z" }, + { url = "https://files.pythonhosted.org/packages/2a/dc/03734d80e362cd43ef65428e9de77c730ce7f2f11c60d2b1e1b39f0fbf99/pydantic_core-2.46.4-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:133878133d271ade3d41d1bfb2a45ec38dbdbda40bc065921c6b04e4630127e2", size = 2134492, upload-time = "2026-05-06T13:36:58.124Z" }, + { url = "https://files.pythonhosted.org/packages/de/df/5e5ffc085ed07cc22d298134d3d911c63e91f6a0eb91fe646750a3209910/pydantic_core-2.46.4-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9bc519fbf2b7578398853d815009ae5e4d4603d12f4e3f91da8c06852d3da3e9", size = 2156604, upload-time = "2026-05-06T13:37:49.88Z" }, + { url = "https://files.pythonhosted.org/packages/81/44/6e112a4253e56f5705467cbab7ab5e91ee7398ba3d56d358635958893d3e/pydantic_core-2.46.4-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c7a7bd4e39e8e4c12c39cd480356842b6a8a06e41b23a55a5e3e191718838ddf", size = 2183828, upload-time = "2026-05-06T13:37:43.053Z" }, + { url = "https://files.pythonhosted.org/packages/ac/ad/5565071e937d8e752842ac241463944c9eb14c87e2d269f2658a5bd05e98/pydantic_core-2.46.4-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:d396ec2b979760aaf3218e76c24e65bd0aca24983298653b3a9d7a45f9e47b30", size = 2310000, upload-time = "2026-05-06T13:37:56.694Z" }, + { url = "https://files.pythonhosted.org/packages/4f/c3/66883a5cec183e7fba4d024b4cbbe61851a63750ef606b0afecc46d1f2bf/pydantic_core-2.46.4-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:86e1a4418c6cd97d60c95c71164158eaf7324fae7b0923264016baa993eba6fc", size = 2361286, upload-time = "2026-05-06T13:40:05.667Z" }, + { url = "https://files.pythonhosted.org/packages/4b/2d/69abac8f838090bbecd5df894befb2c2619e7996a98ddb949db9f3b93225/pydantic_core-2.46.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d51026d73fcfd93610abc7b27789c26b313920fcfb20e27462d74a7f8b06e983", size = 2193071, upload-time = "2026-05-06T13:38:08.682Z" }, +] + +[[package]] +name = "structlog" +version = "25.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ef/52/9ba0f43b686e7f3ddfeaa78ac3af750292662284b3661e91ad5494f21dbc/structlog-25.5.0.tar.gz", hash = "sha256:098522a3bebed9153d4570c6d0288abf80a031dfdb2048d59a49e9dc2190fc98", size = 1460830, upload-time = "2025-10-27T08:28:23.028Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/45/a132b9074aa18e799b891b91ad72133c98d8042c70f6240e4c5f9dabee2f/structlog-25.5.0-py3-none-any.whl", hash = "sha256:a8453e9b9e636ec59bd9e79bbd4a72f025981b3ba0f5837aebf48f02f37a7f9f", size = 72510, upload-time = "2025-10-27T08:28:21.535Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, +] From 37d80051b7640715c15f8f7e91fe11f059c08faf Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Fri, 22 May 2026 13:41:47 -0700 Subject: [PATCH 5/9] Fix stale references in CONTRIBUTING.md and nix.sh The previous restructuring commit on this branch replaced the up CLI's test runner with nix flake check, dropped the lib/ shared library in favor of per-function inlining, and started committing generated schemas to git. CONTRIBUTING.md still described the old structure and referenced non-existent files and commands. This commit updates CONTRIBUTING.md to match what the tree actually looks like: tests run via nix flake check (no test-crossplane app exists), schemas/python/ is committed and regenerated via nix run .#generate, the function layout puts Composer and compose() in fn.py, and tests are unittest-based with no helpers module. It also fixes a stale example in nix.sh's header comment. Signed-off-by: Nic Cope --- CONTRIBUTING.md | 78 ++++++++++++++++++++++++------------------------- nix.sh | 2 +- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 16e39e21d..44319aeef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,21 +22,16 @@ nix develop ## Running checks -`nix flake check` runs all of the project's checks (linters, formatters) inside -the Nix sandbox. Run `nix flake show` to see what's available. +`nix flake check` runs all of the project's checks — Python, shell, and Nix +linters and formatters, plus unit tests for every composition function — +inside the Nix sandbox. Run `nix flake show` to see what else is available. ```bash nix flake check # or: ./nix.sh flake check ``` -Unit tests build the Crossplane project with `crossplane project build` (to -generate Pydantic models), then run pytest: - -```bash -nix run .#test-crossplane # or: ./nix.sh run .#test-crossplane -``` - -Run both before opening a PR. +`nix run .#fix` auto-fixes most lint and formatting issues. Run it before +opening a PR. ## Working on composition functions @@ -45,54 +40,59 @@ lives in Python composition functions under `functions/`. See [`skills/crossplane-python-functions/SKILL.md`](skills/crossplane-python-functions/SKILL.md) for a detailed guide. -Each function is a self-contained Python package: +Each function is a self-contained Python package, built as a hatch project and +managed in the workspace `uv.lock`: ``` functions// - pyproject.toml # Declares deps on crossplane-models, modelplanelib, SDK + pyproject.toml # Hatch package metadata; declares SDK and models deps function/ __init__.py __version__.py main.py # CLI entrypoint (boilerplate) - fn.py # FunctionRunner gRPC service (boilerplate) - compose.py # The actual composition logic + fn.py # FunctionRunner gRPC service and Composer logic + tests/ + test_fn.py # unittest-based tests for fn.py ``` -The `compose(req, rsp)` function in `compose.py` reads the XR from the request, -composes resources into the response, and tracks readiness. Functions use +The `Composer.compose()` method in `fn.py` reads the XR from the request, +composes resources into the response, and tracks readiness. `FunctionRunner` +is the gRPC service that wires `Composer` to the SDK's runtime. Functions use generated Pydantic models (in `schemas/python/`) for type-safe access to XR -specs and status, and shared utilities from `lib/modelplanelib/`. - -Build before you code. The Pydantic models are generated by `crossplane project -build` (or `nix run .#build-crossplane`), so you need to build after changing an -XRD and before writing function code that imports the models. +specs and status. Each function is self-contained — there is no shared library. Common patterns -like setting conditions, updating status, and building child resource names are -provided by the [Crossplane Python Function SDK](https://github.com/crossplane/function-sdk-python). +like setting conditions, updating status, and building child resource names +are provided by the +[Crossplane Python Function SDK](https://github.com/crossplane/function-sdk-python). Helpers specific to a single function live in that function's `function/` -package. +package alongside `fn.py`. -### Tests +The Pydantic models in `schemas/python/` are generated from the XRDs under +`apis/` and the project's dependency CRDs. They're committed to git so tests +and type checking don't need to run the Crossplane CLI first. Regenerate them +after changing an XRD or bumping a dependency: -Every function has at least one corresponding test in `tests/`. Tests are pytest -unit tests that call `compose(req, rsp)` directly with a -`RunFunctionRequest`/`RunFunctionResponse` pair and assert on the response. +```bash +nix run .#generate +``` + +### Tests -Tests use Pydantic models to build typed inputs (XRs, required resources) via -the `build_request()` helper in `tests/helpers.py`, and assert on the desired -resources, conditions, and status in the response. +Every function has tests under `functions//tests/test_fn.py`. Tests are +`unittest.IsolatedAsyncioTestCase` cases that build a typed `RunFunctionRequest` +from generated Pydantic models, call `FunctionRunner.RunFunction()`, and +compare the resulting `RunFunctionResponse` against an expected response via +`json_format.MessageToDict`. -To add a test, add cases to the existing `tests/test_.py` file (or -create a new one for a new function). Then run `nix run .#test-crossplane` to -verify it passes. +Add new cases to the function's existing `test_fn.py`. Run `nix flake check` +to verify they pass. ## Submitting changes Sign off your commits using `git commit -s`. This adds a `Signed-off-by` line -certifying you have the right to submit the code under the project's license (the -[Developer Certificate of Origin](https://developercertificate.org/)). +certifying you have the right to submit the code under the project's license +(the [Developer Certificate of Origin](https://developercertificate.org/)). -Before opening a PR, run `nix flake check` and `nix run .#test-crossplane` and -make sure both pass. If you changed a composition function, make sure there's a -test covering the change. +Before opening a PR, run `nix flake check` and make sure it passes. If you +changed a composition function, make sure there's a test covering the change. diff --git a/nix.sh b/nix.sh index bc1acd196..e58bfe71c 100755 --- a/nix.sh +++ b/nix.sh @@ -4,7 +4,7 @@ # Usage: ./nix.sh # # Run './nix.sh flake show' for available apps and packages, or see flake.nix. -# Examples: ./nix.sh run .#test-crossplane, ./nix.sh build, ./nix.sh develop +# Examples: ./nix.sh flake check, ./nix.sh run .#build-crossplane, ./nix.sh develop # # The first run downloads dependencies into /nix/store (cached in a Docker # volume). Subsequent runs reuse the cache. To reset: docker volume rm modelplane-nix From dfd66eabe813149d5fe59180982a422a25fa8395 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Fri, 22 May 2026 14:03:51 -0700 Subject: [PATCH 6/9] Switch build backend from hatchling to uv_build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each function and the schemas/python workspace member used hatchling as its PEP 517 build backend, with hatch-version reading 0.0.0.dev0 from a per-function __version__.py shim. The version was never surfaced anywhere — the OCI images are tagged latest by Nix and the project tag comes from git via the flake — so the dynamic-version machinery was boilerplate without a purpose. uv ships its own build backend (uv_build) that integrates with uv2nix the same way hatchling does and matches our requirements: pure-Python wheels, a non-default module layout (function/, not src//), and inclusion of data files alongside the module. Switching drops 9 __version__.py shims and tightens each pyproject.toml. uv_build follows uv's versioning policy, so the dev shell needs a matching uv. This commit adds a nixpkgs-unstable input exposed as pkgs.unstable and pulls uv from there to track recent uv_build releases. The overlay is also a general escape hatch for future packages we'd want newer than nixos-25.11 ships. Two related additions: - A uv-lock check fails nix flake check when uv.lock is out of sync with any pyproject.toml. Nothing previously caught a contributor editing a pyproject.toml without running uv lock; uv2nix would either build against the stale pin or fail with a less helpful error. - nix run .#fix now runs uv lock so contributors don't need to remember a separate step after editing dependencies. Signed-off-by: Nic Cope --- flake.lock | 17 +++++++++++ flake.nix | 15 +++++++++- .../function/__version__.py | 3 -- functions/compose-gke-cluster/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-inference-class/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-inference-cluster/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-inference-gateway/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-kserve-backend/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-model-deployment/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-model-endpoint/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-model-replica/pyproject.toml | 16 ++++------ .../function/__version__.py | 3 -- .../compose-model-service/pyproject.toml | 16 ++++------ nix/apps.nix | 4 +++ nix/checks.nix | 29 +++++++++++++++++++ schemas/python/pyproject.toml | 9 +++--- uv.lock | 9 ++++++ 24 files changed, 132 insertions(+), 122 deletions(-) delete mode 100644 functions/compose-gke-cluster/function/__version__.py delete mode 100644 functions/compose-inference-class/function/__version__.py delete mode 100644 functions/compose-inference-cluster/function/__version__.py delete mode 100644 functions/compose-inference-gateway/function/__version__.py delete mode 100644 functions/compose-kserve-backend/function/__version__.py delete mode 100644 functions/compose-model-deployment/function/__version__.py delete mode 100644 functions/compose-model-endpoint/function/__version__.py delete mode 100644 functions/compose-model-replica/function/__version__.py delete mode 100644 functions/compose-model-service/function/__version__.py diff --git a/flake.lock b/flake.lock index 4f29915d6..a7a63d288 100644 --- a/flake.lock +++ b/flake.lock @@ -94,6 +94,22 @@ "type": "github" } }, + "nixpkgs-unstable_2": { + "locked": { + "lastModified": 1779357205, + "narHash": "sha256-cCO8aTqss5x9Ky8GWkpY0Hy5fyTZEbtifSUV8QjSzic=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f83fc3c307e74bc5fd5adb7eb6b8b13ffd2a36e1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1779102034, @@ -160,6 +176,7 @@ "inputs": { "crossplane-cli": "crossplane-cli", "nixpkgs": "nixpkgs_2", + "nixpkgs-unstable": "nixpkgs-unstable_2", "pyproject-build-systems": "pyproject-build-systems", "pyproject-nix": "pyproject-nix", "uv2nix": "uv2nix" diff --git a/flake.nix b/flake.nix index a48dc3989..9fa1e06a3 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,11 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + # Unstable nixpkgs, exposed as pkgs.unstable. Used when we need a + # newer version of a package than the stable channel ships, e.g. uv + # tracking the latest uv_build releases. + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + # Pinned to the 'diy' branch until crossplane/cli#24 merges. crossplane-cli.url = "github:negz/cli/diy"; @@ -37,6 +42,7 @@ { self, nixpkgs, + nixpkgs-unstable, crossplane-cli, pyproject-nix, uv2nix, @@ -93,6 +99,13 @@ pkgs = import nixpkgs { inherit system; config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "upbound" ]; + overlays = [ + (_: _: { + unstable = import nixpkgs-unstable { + inherit system; + }; + }) + ]; }; }; @@ -165,7 +178,7 @@ pkgs.kubernetes-helm pkgs.kind pkgs.docker-client - pkgs.uv + pkgs.unstable.uv pkgs.python3 pkgs.ruff pkgs.pyright diff --git a/functions/compose-gke-cluster/function/__version__.py b/functions/compose-gke-cluster/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-gke-cluster/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-gke-cluster/pyproject.toml b/functions/compose-gke-cluster/pyproject.toml index bbaa3f07f..ce6a68705 100644 --- a/functions/compose-gke-cluster/pyproject.toml +++ b/functions/compose-gke-cluster/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-gke-cluster" +version = "0.0.0" description = "Compose a GKE cluster with networking, node pools, and service accounts." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-inference-class/function/__version__.py b/functions/compose-inference-class/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-inference-class/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-inference-class/pyproject.toml b/functions/compose-inference-class/pyproject.toml index 63fb9e5f8..8448edcff 100644 --- a/functions/compose-inference-class/pyproject.toml +++ b/functions/compose-inference-class/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-inference-class" +version = "0.0.0" description = "Mark an InferenceClass as ready." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-inference-cluster/function/__version__.py b/functions/compose-inference-cluster/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-inference-cluster/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-inference-cluster/pyproject.toml b/functions/compose-inference-cluster/pyproject.toml index 7a0e709af..78761d3a8 100644 --- a/functions/compose-inference-cluster/pyproject.toml +++ b/functions/compose-inference-cluster/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-inference-cluster" +version = "0.0.0" description = "Compose an InferenceCluster from a cluster source and KServe backend." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-inference-gateway/function/__version__.py b/functions/compose-inference-gateway/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-inference-gateway/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-inference-gateway/pyproject.toml b/functions/compose-inference-gateway/pyproject.toml index 765ff22ed..8037b6b0a 100644 --- a/functions/compose-inference-gateway/pyproject.toml +++ b/functions/compose-inference-gateway/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-inference-gateway" +version = "0.0.0" description = "Compose the control plane routing gateway with Envoy Gateway and MetalLB." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-kserve-backend/function/__version__.py b/functions/compose-kserve-backend/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-kserve-backend/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-kserve-backend/pyproject.toml b/functions/compose-kserve-backend/pyproject.toml index 1eadd5365..8f97e603b 100644 --- a/functions/compose-kserve-backend/pyproject.toml +++ b/functions/compose-kserve-backend/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-kserve-backend" +version = "0.0.0" description = "Install KServe and supporting components on a remote cluster." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-model-deployment/function/__version__.py b/functions/compose-model-deployment/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-model-deployment/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-deployment/pyproject.toml b/functions/compose-model-deployment/pyproject.toml index 35a3eea1d..317cf3273 100644 --- a/functions/compose-model-deployment/pyproject.toml +++ b/functions/compose-model-deployment/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-model-deployment" +version = "0.0.0" description = "Fan out a ModelDeployment to ModelReplicas and ModelEndpoints." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-model-endpoint/function/__version__.py b/functions/compose-model-endpoint/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-model-endpoint/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-endpoint/pyproject.toml b/functions/compose-model-endpoint/pyproject.toml index c87f56237..9c714d333 100644 --- a/functions/compose-model-endpoint/pyproject.toml +++ b/functions/compose-model-endpoint/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-model-endpoint" +version = "0.0.0" description = "Compose an Envoy Gateway Backend from a ModelEndpoint." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-model-replica/function/__version__.py b/functions/compose-model-replica/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-model-replica/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-replica/pyproject.toml b/functions/compose-model-replica/pyproject.toml index 24016c947..0534a7811 100644 --- a/functions/compose-model-replica/pyproject.toml +++ b/functions/compose-model-replica/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-model-replica" +version = "0.0.0" description = "Deploy a model on a single InferenceCluster via KServe." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/functions/compose-model-service/function/__version__.py b/functions/compose-model-service/function/__version__.py deleted file mode 100644 index 1c8a94c50..000000000 --- a/functions/compose-model-service/function/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version is set at build time by hatch-vcs.""" - -__version__ = "0.0.0.dev0" diff --git a/functions/compose-model-service/pyproject.toml b/functions/compose-model-service/pyproject.toml index 5c7e9001b..b14949f0f 100644 --- a/functions/compose-model-service/pyproject.toml +++ b/functions/compose-model-service/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "compose-model-service" +version = "0.0.0" description = "Compose a Gateway API HTTPRoute from a ModelService." requires-python = ">=3.11,<3.14" license = "Apache-2.0" @@ -13,7 +14,6 @@ dependencies = [ "grpcio>=1.73.1", "crossplane-models", ] -dynamic = ["version"] [tool.uv.sources] crossplane-models = { workspace = true } @@ -21,10 +21,6 @@ crossplane-models = { workspace = true } [project.scripts] function = "function.main:cli" -[tool.hatch.build.targets.wheel] -packages = ["function"] - -[tool.hatch.version] -path = "function/__version__.py" -validate-bump = false - +[tool.uv.build-backend] +module-name = "function" +module-root = "" diff --git a/nix/apps.nix b/nix/apps.nix index 35f4b289c..0d4b392c5 100644 --- a/nix/apps.nix +++ b/nix/apps.nix @@ -21,6 +21,7 @@ pkgs.shellcheck pkgs.shfmt pkgs.gnupatch + pkgs.unstable.uv ]; inheritPath = false; text = '' @@ -39,6 +40,9 @@ echo "Formatting and linting Python..." ruff format functions/ ruff check --fix functions/ + + echo "Refreshing uv.lock..." + uv lock ''; } ); diff --git a/nix/checks.nix b/nix/checks.nix index 062b1e848..97479a902 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -90,6 +90,35 @@ in mkdir -p $out touch $out/.nix-lint-passed ''; + + # Fail if uv.lock is out of sync with any pyproject.toml in the workspace. + # uv lock --check resolves the workspace against the lockfile without + # writing it. The sandbox has no network, no writable HOME, and no + # /bin/sh for uv's interpreter discovery, so: + # + # --offline skip the network + # UV_CACHE_DIR=... write cache into the build dir + # --no-managed-python don't try to download a Python + # --python ${pkgs.python3}/bin/python use the nix-provided interpreter + uv-lock = + pkgs.runCommand "modelplane-uv-lock" + { + nativeBuildInputs = [ + pkgs.unstable.uv + pkgs.python3 + ]; + env.UV_CACHE_DIR = "uv-cache"; + } + '' + cp -r ${self} src + chmod -R u+w src + cd src + uv lock --check --offline \ + --no-managed-python \ + --python ${pkgs.python3}/bin/python + mkdir -p $out + touch $out/.uv-lock-passed + ''; } // builtins.listToAttrs ( map (name: { diff --git a/schemas/python/pyproject.toml b/schemas/python/pyproject.toml index 193120617..1f76b3b4e 100644 --- a/schemas/python/pyproject.toml +++ b/schemas/python/pyproject.toml @@ -1,11 +1,12 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.11.0,<0.12"] +build-backend = "uv_build" [project] name = "crossplane-models" version = "0.0.0" requires-python = ">=3.11,<3.14" -[tool.hatch.build.targets.wheel] -packages = ["models"] +[tool.uv.build-backend] +module-name = "models" +module-root = "" diff --git a/uv.lock b/uv.lock index 16677c327..e9e86b84b 100644 --- a/uv.lock +++ b/uv.lock @@ -49,6 +49,7 @@ wheels = [ [[package]] name = "compose-gke-cluster" +version = "0.0.0" source = { editable = "functions/compose-gke-cluster" } dependencies = [ { name = "click" }, @@ -67,6 +68,7 @@ requires-dist = [ [[package]] name = "compose-inference-class" +version = "0.0.0" source = { editable = "functions/compose-inference-class" } dependencies = [ { name = "click" }, @@ -85,6 +87,7 @@ requires-dist = [ [[package]] name = "compose-inference-cluster" +version = "0.0.0" source = { editable = "functions/compose-inference-cluster" } dependencies = [ { name = "click" }, @@ -103,6 +106,7 @@ requires-dist = [ [[package]] name = "compose-inference-gateway" +version = "0.0.0" source = { editable = "functions/compose-inference-gateway" } dependencies = [ { name = "click" }, @@ -121,6 +125,7 @@ requires-dist = [ [[package]] name = "compose-kserve-backend" +version = "0.0.0" source = { editable = "functions/compose-kserve-backend" } dependencies = [ { name = "click" }, @@ -139,6 +144,7 @@ requires-dist = [ [[package]] name = "compose-model-deployment" +version = "0.0.0" source = { editable = "functions/compose-model-deployment" } dependencies = [ { name = "click" }, @@ -157,6 +163,7 @@ requires-dist = [ [[package]] name = "compose-model-endpoint" +version = "0.0.0" source = { editable = "functions/compose-model-endpoint" } dependencies = [ { name = "click" }, @@ -175,6 +182,7 @@ requires-dist = [ [[package]] name = "compose-model-replica" +version = "0.0.0" source = { editable = "functions/compose-model-replica" } dependencies = [ { name = "click" }, @@ -193,6 +201,7 @@ requires-dist = [ [[package]] name = "compose-model-service" +version = "0.0.0" source = { editable = "functions/compose-model-service" } dependencies = [ { name = "click" }, From 401e962089bfff1818f078d0cfe17ee408e96be7 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Fri, 22 May 2026 14:11:06 -0700 Subject: [PATCH 7/9] Remove pyright from the dev shell and pyproject.toml pyright was installed in the dev shell and had a [tool.pyright] config block in pyproject.toml, but nothing in the project actually ran it. nix flake check, nix run .#fix, and the CI workflow all skip type checking. The config was aspirational, not functional. Drop both. A follow-up will reintroduce type checking with a checker that's actually wired into CI. Signed-off-by: Nic Cope --- flake.nix | 1 - pyproject.toml | 5 ----- 2 files changed, 6 deletions(-) diff --git a/flake.nix b/flake.nix index 9fa1e06a3..9daabe333 100644 --- a/flake.nix +++ b/flake.nix @@ -181,7 +181,6 @@ pkgs.unstable.uv pkgs.python3 pkgs.ruff - pkgs.pyright pkgs.nixfmt-rfc-style ]; diff --git a/pyproject.toml b/pyproject.toml index 34e8fa419..ea326c5ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,8 +50,3 @@ max-args = 8 "**/tests/**" = ["E501", "PLR2004", "PLR0913"] # fn.py uses gRPC's required PascalCase method name. "functions/*/function/fn.py" = ["N802"] - -[tool.pyright] -pythonVersion = "3.12" -include = ["functions"] -exclude = ["schemas"] From cd6d2a3542edc2dadd9ddafb57070a86aeb577f2 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Fri, 22 May 2026 21:13:05 -0700 Subject: [PATCH 8/9] Generate ModelCache schemas Signed-off-by: Nic Cope --- schemas/.lock.json | 2 +- .../modelplane/inferencecluster/v1alpha1.py | 22 +++ .../ai/modelplane/modelcache/__init__.py | 0 .../ai/modelplane/modelcache/v1alpha1.py | 162 ++++++++++++++++++ .../ai/modelplane/modeldeployment/v1alpha1.py | 11 ++ .../ai/modelplane/modelreplica/v1alpha1.py | 8 + .../io/k8s/apimachinery/pkg/apis/meta/v1.py | 2 +- schemas/python/pyproject.toml | 9 +- 8 files changed, 209 insertions(+), 7 deletions(-) create mode 100644 schemas/python/models/ai/modelplane/modelcache/__init__.py create mode 100644 schemas/python/models/ai/modelplane/modelcache/v1alpha1.py diff --git a/schemas/.lock.json b/schemas/.lock.json index a212df5cf..880b60f4c 100644 --- a/schemas/.lock.json +++ b/schemas/.lock.json @@ -1 +1 @@ -{"packages":{"fs://apis":"90a83f65b668ef2d0d2410c0e9c2a470535717f55a06829b0cd8ec0431c5b7f8","git://https://github.com/crossplane/crossplane/cluster/crds":"32300d8ac6b01bb66702187eea8dee208511c75b","xpkg://xpkg.upbound.io/upbound/provider-gcp-cloudplatform:v2.5.0":"sha256:c84812c0e07576ae1c14103a6f1e69cd1a77b341c5b7939e29c269dd8dc30e03","xpkg://xpkg.upbound.io/upbound/provider-gcp-compute:v2.5.0":"sha256:324c89628bad85f27202dd4322caf969e7d354c9d9895695984301533c939799","xpkg://xpkg.upbound.io/upbound/provider-gcp-container:v2.5.0":"sha256:6e3bb9a041cc1c06b2940904b9c865fe0ea0dd7229e7017dd768e7a55eb18669","xpkg://xpkg.upbound.io/upbound/provider-helm:v1.2.3":"sha256:d81cbe87c15c8555c8388bbb372387084ce8fefdf9a08d0a540a6b4d228a0049","xpkg://xpkg.upbound.io/upbound/provider-helm:v1.2.4":"sha256:e5896e93156845d4f3005abbffa5f1d9468b79944be54203c675f8b61ea54e19","xpkg://xpkg.upbound.io/upbound/provider-kubernetes:v1.2.4":"sha256:b32140022ee86530424da210ed8544f561592a350dc3467365719ffde8c124e1","xpkg://xpkg.upbound.io/upbound/provider-kubernetes:v1.2.5":"sha256:8c9788629608066abc5ba8ae7039214aeaa89619d810a0bfc337102c4f4a897d"}} \ No newline at end of file +{"packages":{"fs://apis":"0db8cc8aff0633014ab1049c4f2a70c3fd78ec10641df3dd0552b13cd7fb7cae","git://https://github.com/crossplane/crossplane/cluster/crds":"32300d8ac6b01bb66702187eea8dee208511c75b","xpkg://xpkg.upbound.io/upbound/provider-gcp-cloudplatform:v2.5.0":"sha256:c84812c0e07576ae1c14103a6f1e69cd1a77b341c5b7939e29c269dd8dc30e03","xpkg://xpkg.upbound.io/upbound/provider-gcp-compute:v2.5.0":"sha256:324c89628bad85f27202dd4322caf969e7d354c9d9895695984301533c939799","xpkg://xpkg.upbound.io/upbound/provider-gcp-container:v2.5.0":"sha256:6e3bb9a041cc1c06b2940904b9c865fe0ea0dd7229e7017dd768e7a55eb18669","xpkg://xpkg.upbound.io/upbound/provider-helm:v1.2.3":"sha256:d81cbe87c15c8555c8388bbb372387084ce8fefdf9a08d0a540a6b4d228a0049","xpkg://xpkg.upbound.io/upbound/provider-helm:v1.2.4":"sha256:e5896e93156845d4f3005abbffa5f1d9468b79944be54203c675f8b61ea54e19","xpkg://xpkg.upbound.io/upbound/provider-kubernetes:v1.2.4":"sha256:b32140022ee86530424da210ed8544f561592a350dc3467365719ffde8c124e1","xpkg://xpkg.upbound.io/upbound/provider-kubernetes:v1.2.5":"sha256:8c9788629608066abc5ba8ae7039214aeaa89619d810a0bfc337102c4f4a897d"}} \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py b/schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py index 10166418b..a82ffdc2c 100644 --- a/schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py +++ b/schemas/python/models/ai/modelplane/inferencecluster/v1alpha1.py @@ -11,6 +11,13 @@ from ....io.k8s.apimachinery.pkg.apis.meta import v1 +class Cache(BaseModel): + storageClassName: Optional[constr(min_length=1)] = 'modelplane-rwx' + """ + Name of the RWX StorageClass for ModelCache PVCs. The admin creates the StorageClass on the workload cluster (must support ReadWriteMany dynamic provisioning). + """ + + class IdentitySecretRef(BaseModel): key: Optional[constr(min_length=1, max_length=253)] = 'private_key' name: constr(min_length=1, max_length=253) @@ -22,6 +29,10 @@ class SecretRef(BaseModel): class Existing(BaseModel): + cache: Optional[Cache] = None + """ + ModelCache configuration for this cluster. + """ identitySecretRef: Optional[IdentitySecretRef] = None """ Optional reference to a Secret containing cloud provider credentials for IAM-based authentication. @@ -32,7 +43,18 @@ class Existing(BaseModel): """ +class CacheModel(BaseModel): + storageClassName: Optional[constr(min_length=1)] = 'modelplane-rwx' + """ + Name of the RWX StorageClass for ModelCache PVCs. At the default value, Modelplane provisions Filestore Enterprise via the Filestore CSI addon and composes the StorageClass; set this to a different name to use one the admin has already created. + """ + + class Gke(BaseModel): + cache: Optional[CacheModel] = None + """ + ModelCache configuration for this cluster. + """ kubernetesVersion: Optional[str] = '1.35' project: constr(min_length=6, max_length=30) region: constr(min_length=1, max_length=32) diff --git a/schemas/python/models/ai/modelplane/modelcache/__init__.py b/schemas/python/models/ai/modelplane/modelcache/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/schemas/python/models/ai/modelplane/modelcache/v1alpha1.py b/schemas/python/models/ai/modelplane/modelcache/v1alpha1.py new file mode 100644 index 000000000..cd3d6a70d --- /dev/null +++ b/schemas/python/models/ai/modelplane/modelcache/v1alpha1.py @@ -0,0 +1,162 @@ +# generated by datamodel-codegen: +# filename: workdir/modelplane_ai_v1alpha1_modelcache.yaml + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, List, Literal, Optional + +from pydantic import BaseModel, conint, constr + +from ....io.k8s.apimachinery.pkg.apis.meta import v1 + + +class ClusterSelector(BaseModel): + matchLabels: Optional[Dict[str, Any]] = None + + +class CompositionRef(BaseModel): + name: str + + +class CompositionRevisionRef(BaseModel): + name: str + + +class CompositionRevisionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class CompositionSelector(BaseModel): + matchLabels: Dict[str, str] + + +class ResourceRef(BaseModel): + apiVersion: str + kind: str + name: Optional[str] = None + + +class Crossplane(BaseModel): + compositionRef: Optional[CompositionRef] = None + compositionRevisionRef: Optional[CompositionRevisionRef] = None + compositionRevisionSelector: Optional[CompositionRevisionSelector] = None + compositionSelector: Optional[CompositionSelector] = None + compositionUpdatePolicy: Optional[Literal['Automatic', 'Manual']] = None + resourceRefs: Optional[List[ResourceRef]] = None + + +class AuthSecret(BaseModel): + key: Optional[str] = 'HF_TOKEN' + name: constr(min_length=1) + + +class HuggingFace(BaseModel): + authSecret: Optional[AuthSecret] = None + """ + Optional Secret holding an HF token for gated or private repos. Resolved on the workload cluster at hydration time. + """ + repo: constr(min_length=1) + """ + HuggingFace repository ID. + """ + revision: Optional[str] = None + """ + Branch, tag, or commit SHA. Defaults to the repo's default branch. + """ + sizeGiB: conint(ge=1, le=100000) + """ + Capacity to allocate for the staged artifact on each matched cluster. + """ + + +class Source(BaseModel): + huggingFace: Optional[HuggingFace] = None + + +class Spec(BaseModel): + clusterSelector: Optional[ClusterSelector] = None + """ + Label selector to pick the InferenceClusters that stage this artifact. If omitted, the cache replicates to every cluster. + """ + crossplane: Optional[Crossplane] = None + """ + Configures how Crossplane will reconcile this composite resource + """ + source: Source + """ + Where to fetch the artifact from. A discriminated union; exactly one source must be set. + """ + + +class Cluster(BaseModel): + message: Optional[str] = None + name: str + phase: Optional[Literal['Pending', 'Hydrating', 'Ready', 'Failed']] = None + + +class Condition(BaseModel): + lastTransitionTime: datetime + message: Optional[str] = None + observedGeneration: Optional[int] = None + reason: str + status: str + type: str + + +class Summary(BaseModel): + ready: Optional[str] = None + """ + e.g. "2/3" + """ + + +class Status(BaseModel): + clusters: Optional[List[Cluster]] = None + """ + Per-cluster staging status. + """ + conditions: Optional[List[Condition]] = None + """ + Conditions of the resource. + """ + summary: Optional[Summary] = None + """ + Per-cluster ready / total counts. + """ + + +class ModelCache(BaseModel): + apiVersion: Optional[Literal['modelplane.ai/v1alpha1']] = 'modelplane.ai/v1alpha1' + """ + 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[Literal['ModelCache']] = 'ModelCache' + """ + 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] = None + """ + Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + """ + spec: Spec + status: Optional[Status] = None + + +class ModelCacheList(BaseModel): + apiVersion: Optional[str] = None + """ + 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 + """ + items: List[ModelCache] + """ + List of modelcaches. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + """ + kind: Optional[str] = None + """ + 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.ListMeta] = None + """ + Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + """ \ No newline at end of file diff --git a/schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py b/schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py index 9598b6366..77dcf986c 100644 --- a/schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py +++ b/schemas/python/models/ai/modelplane/modeldeployment/v1alpha1.py @@ -46,6 +46,13 @@ class Crossplane(BaseModel): resourceRefs: Optional[List[ResourceRef]] = None +class ModelCacheRef(BaseModel): + name: constr(min_length=1) + """ + ModelCache resource name in the same namespace. + """ + + class Metadata(BaseModel): annotations: Optional[Dict[str, str]] = None labels: Optional[Dict[str, str]] = None @@ -154,6 +161,10 @@ class SpecModel(BaseModel): """ Configures how Crossplane will reconcile this composite resource """ + modelCacheRef: Optional[ModelCacheRef] = None + """ + Reference to a ModelCache in the same namespace. Optional for single-node deployments; required for multi-node (workers.topology.pipeline > 1). + """ replicas: conint(ge=1, le=10) """ How many ModelReplicas to fan out to. Each replica is a complete serving instance scheduled to one InferenceCluster. diff --git a/schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py b/schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py index aede90b29..e3fd76043 100644 --- a/schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py +++ b/schemas/python/models/ai/modelplane/modelreplica/v1alpha1.py @@ -46,6 +46,10 @@ class InferenceClusterRef(BaseModel): name: str +class ModelCacheRef(BaseModel): + name: constr(min_length=1) + + class Metadata(BaseModel): annotations: Optional[Dict[str, str]] = None labels: Optional[Dict[str, str]] = None @@ -115,6 +119,10 @@ class SpecModel(BaseModel): """ Reference to the InferenceCluster this replica targets. """ + modelCacheRef: Optional[ModelCacheRef] = None + """ + Optional reference to a ModelCache mounted into the engine pod. Inherited verbatim from the parent ModelDeployment. + """ workers: Workers diff --git a/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py b/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py index c9d0a9811..cc3f259fe 100644 --- a/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py +++ b/schemas/python/models/io/k8s/apimachinery/pkg/apis/meta/v1.py @@ -1,5 +1,5 @@ # generated by datamodel-codegen: -# filename: workdir/apiextensions_crossplane_io_v1_compositeresourcedefinition.yaml +# filename: workdir/infrastructure_modelplane_ai_v1alpha1_gkecluster.yaml from __future__ import annotations diff --git a/schemas/python/pyproject.toml b/schemas/python/pyproject.toml index 1f76b3b4e..193120617 100644 --- a/schemas/python/pyproject.toml +++ b/schemas/python/pyproject.toml @@ -1,12 +1,11 @@ [build-system] -requires = ["uv_build>=0.11.0,<0.12"] -build-backend = "uv_build" +requires = ["hatchling"] +build-backend = "hatchling.build" [project] name = "crossplane-models" version = "0.0.0" requires-python = ">=3.11,<3.14" -[tool.uv.build-backend] -module-name = "models" -module-root = "" +[tool.hatch.build.targets.wheel] +packages = ["models"] From bc9c364872ff7e350e84cc9a6849daa13c176c4e Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Fri, 22 May 2026 21:13:19 -0700 Subject: [PATCH 9/9] Plumb docker-credential-up to up project build We need it for fetching deps, not only pushing. Signed-off-by: Nic Cope --- flake.nix | 5 ++++- nix/apps.nix | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 9daabe333..60008002e 100644 --- a/flake.nix +++ b/flake.nix @@ -155,7 +155,10 @@ { fix = apps.fix { }; generate = apps.generate { inherit crossplane pkgs; }; - build-crossplane = apps.buildCrossplane { inherit crossplane functionsPkg; }; + build-crossplane = apps.buildCrossplane { + inherit crossplane functionsPkg; + dockerCredentialUp = pkgs.upbound; + }; push-crossplane = apps.pushCrossplane { inherit crossplane version; dockerCredentialUp = pkgs.upbound; diff --git a/nix/apps.nix b/nix/apps.nix index 0d4b392c5..c5ce278ee 100644 --- a/nix/apps.nix +++ b/nix/apps.nix @@ -76,8 +76,16 @@ # Build the Crossplane project. On Linux, materialises Nix-built function # runtime images into _output/functions/ before invoking the CLI. The CLI # loads them via the Tarball function source in crossplane-project.yaml. + # + # docker-credential-up is needed because `crossplane project build` calls + # `crossplane dependency update-cache` to resolve providers and CRDs from + # xpkg.upbound.io, which requires authentication. buildCrossplane = - { crossplane, functionsPkg }: + { + crossplane, + dockerCredentialUp, + functionsPkg, + }: { type = "app"; meta.description = "Build the Crossplane project"; @@ -86,6 +94,7 @@ name = "modelplane-build-crossplane"; runtimeInputs = [ crossplane + dockerCredentialUp pkgs.coreutils ]; inheritPath = false;